mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
OSX, fixed arrow keys creating TextEntred event.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1789 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
c48792e933
commit
e9a201af21
@ -359,8 +359,20 @@
|
||||
if (myUseKeyRepeat || ![theEvent isARepeat])
|
||||
myRequester->KeyDown([theEvent keyCode], [theEvent modifierFlags]);
|
||||
|
||||
if ((myUseKeyRepeat || ![theEvent isARepeat]) && [[theEvent characters] length] > 0)
|
||||
myRequester->TextEntred([[theEvent characters] characterAtIndex:0]);
|
||||
if ((myUseKeyRepeat || ![theEvent isARepeat]) && [[theEvent characters] length] > 0) {
|
||||
/// From NSEvent.h :
|
||||
/*
|
||||
* Unicodes we reserve for function keys on the keyboard,
|
||||
* OpenStep reserves the range 0xF700-0xF8FF for this purpose.
|
||||
* The availability of various keys will be system dependent.
|
||||
*/
|
||||
/// And 0x35 is the Escape key.
|
||||
unichar ch = [[theEvent characters] characterAtIndex:0];
|
||||
if ([theEvent keyCode] != 0x35 &&
|
||||
(ch < 0xf700 || ch > 0xf8ff)) {
|
||||
myRequester->TextEntered(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
void MouseMovedOut(void);
|
||||
void KeyDown(unsigned short keycode, unsigned int modifierFlags);
|
||||
void KeyUp(unsigned short keycode, unsigned int modifierFlags);
|
||||
void TextEntred(Uint32 charcode);
|
||||
void TextEntered(Uint32 charcode);
|
||||
|
||||
static Key::Code NSKeyCodeToSFMLKeyCode(unsigned short rawchar);
|
||||
|
||||
|
@ -281,7 +281,7 @@ void WindowImplCocoa::KeyUp(unsigned short keycode, unsigned int modifierFlags)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void WindowImplCocoa::TextEntred(Uint32 charcode)
|
||||
void WindowImplCocoa::TextEntered(Uint32 charcode)
|
||||
{
|
||||
Event event;
|
||||
event.Type = Event::TextEntered;
|
||||
|
@ -54,7 +54,7 @@ namespace sf {
|
||||
/// MouseDownAt, MouseUpAt, MouseMovedAt, MouseWheelScrolledAt,
|
||||
/// MouseMovedIn, MouseMovedOut
|
||||
///
|
||||
/// KeyDown, KeyUp, TextEntred
|
||||
/// KeyDown, KeyUp, TextEntered
|
||||
///
|
||||
/// Note : Joystick are not bound to a view or window
|
||||
/// thus they're not managed by a class implementing this protocol.
|
||||
|
Loading…
Reference in New Issue
Block a user