iDevGames Forums
How to disable alert sounds for an application - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: How to disable alert sounds for an application (/thread-852.html)



How to disable alert sounds for an application - AdrianM - Aug 15, 2009 09:50 AM

Is there a way to disable alert sounds for my application? I mixed SFML and created a bundle with a window with no close button(this is a registration window that appears before the game) and everytime i press ESCAPE in my game there's an alert sound that comes up. How can i disable alert sounds or alter their volume? I am using cocoa.


How to disable alert sounds for an application - AnotherJake - Aug 15, 2009 10:49 AM

I think you have to have a view which is a first responder in that window, which must respond to the keyDown method -- at least that's what I do:

Code:
- (void)keyDown:(NSEvent *)theEvent
{
    ; // needed to stop the incessant beeping!
}



How to disable alert sounds for an application - AdrianM - Aug 16, 2009 05:20 AM

AnotherJake Wrote:I think you have to have a view which is a first responder in that window, which must respond to the keyDown method -- at least that's what I do:

Code:
- (void)keyDown:(NSEvent *)theEvent
{
    ; // needed to stop the incessant beeping!
}

Well, it did not help. After some more investigation i discovered it is something with SFML. I created a simple Cocoa application from the template and then pasted in main.mm the opengl sample code, from SFML. I modified it a little bit so that the application will not close when pressing escape. Now the app runs and everytime i press escape an alert sound plays. I did post on the SFML forums but no luck till now. I'm wondering what should i do..


How to disable alert sounds for an application - AdrianM - Aug 16, 2009 01:43 PM

AdrianM Wrote:Well, it did not help. After some more investigation i discovered it is something with SFML. I created a simple Cocoa application from the template and then pasted in main.mm the opengl sample code, from SFML. I modified it a little bit so that the application will not close when pressing escape. Now the app runs and everytime i press escape an alert sound plays. I did post on the SFML forums but no luck till now. I'm wondering what should i do..

The issue was due to SFML, after talking to the admin there, i downloaded the latest sources for SFML from the SVN, the unwanted alert went away.