mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-19 06:40:42 +00:00
Use NSWindow noResponseFor: to avoid beeps on Skia/OSX fork
This commit is contained in:
parent
df9c555c87
commit
8e06d61f74
@ -131,9 +131,7 @@ bool is_key_pressed(KeyScancode scancode)
|
|||||||
|
|
||||||
- (void)keyDown:(NSEvent*)event
|
- (void)keyDown:(NSEvent*)event
|
||||||
{
|
{
|
||||||
#if 0 // Avoid beeps TODO comment this when the OS X menus are ready
|
|
||||||
[super keyDown:event];
|
[super keyDown:event];
|
||||||
#endif
|
|
||||||
|
|
||||||
KeyScancode scancode = cocoavk_to_scancode(event.keyCode);
|
KeyScancode scancode = cocoavk_to_scancode(event.keyCode);
|
||||||
if (scancode >= 0 && scancode < kKeyScancodes)
|
if (scancode >= 0 && scancode < kKeyScancodes)
|
||||||
@ -155,9 +153,7 @@ bool is_key_pressed(KeyScancode scancode)
|
|||||||
|
|
||||||
- (void)keyUp:(NSEvent*)event
|
- (void)keyUp:(NSEvent*)event
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
[super keyUp:event];
|
[super keyUp:event];
|
||||||
#endif
|
|
||||||
|
|
||||||
KeyScancode scancode = cocoavk_to_scancode(event.keyCode);
|
KeyScancode scancode = cocoavk_to_scancode(event.keyCode);
|
||||||
if (scancode >= 0 && scancode < kKeyScancodes)
|
if (scancode >= 0 && scancode < kKeyScancodes)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// SHE library
|
// SHE library
|
||||||
// Copyright (C) 2012-2015 David Capello
|
// Copyright (C) 2012-2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -158,4 +158,14 @@ using namespace she;
|
|||||||
return (nsCursor != nil ? YES: NO);
|
return (nsCursor != nil ? YES: NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)noResponderFor:(SEL)eventSelector
|
||||||
|
{
|
||||||
|
if (eventSelector == @selector(keyDown:)) {
|
||||||
|
// Do nothing (avoid beep)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[super noResponderFor:eventSelector];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user