How to disable alert sounds for an application

Member
Posts: 29
Joined: 2008.10
Post: #1
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.
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #2
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!
}
Quote this message in a reply
Member
Posts: 29
Joined: 2008.10
Post: #3
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..
Quote this message in a reply
Member
Posts: 29
Joined: 2008.10
Post: #4
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.
Quote this message in a reply
Post Reply