diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-10-13 19:26:18 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-10-13 19:26:18 +0000 |
| commit | a26d5408a1f90a073aef48ddf67010b87d06553c (patch) | |
| tree | 005fb5035b82f35aae74f83fc1476512d0180828 /src/Fl_mac.cxx | |
| parent | 3fda0918b652be74081039f5cece649d21e329e8 (diff) | |
STR 1952: Fixed first modifier key event, some minor utf8 orrections.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6416 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_mac.cxx')
| -rw-r--r-- | src/Fl_mac.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 213b3a636..f90d95609 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -165,7 +165,7 @@ static unsigned short macKeyLookUp[128] = /** * convert the current mouse chord into the FLTK modifier state */ -static void mods_to_e_state( UInt32 mods ) +static unsigned int mods_to_e_state( UInt32 mods ) { long state = 0; if ( mods & kEventKeyModifierNumLockMask ) state |= FL_NUM_LOCK; @@ -174,8 +174,10 @@ static void mods_to_e_state( UInt32 mods ) if ( mods & (controlKey|rightControlKey) ) state |= FL_CTRL; if ( mods & (shiftKey|rightShiftKey) ) state |= FL_SHIFT; if ( mods & alphaLock ) state |= FL_CAPS_LOCK; - Fl::e_state = ( Fl::e_state & 0xff000000 ) | state; + unsigned int ret = ( Fl::e_state & 0xff000000 ) | state; + Fl::e_state = ret; //printf( "State 0x%08x (%04x)\n", Fl::e_state, mods ); + return ret; } @@ -1212,7 +1214,7 @@ pascal OSStatus carbonKeyboardHandler( Fl_Window *window = (Fl_Window*)userData; Fl::first_window(window); UInt32 mods; - static UInt32 prevMods = 0xffffffff; + static UInt32 prevMods = mods_to_e_state( GetCurrentKeyModifiers() ); fl_lock_function(); @@ -1221,7 +1223,6 @@ pascal OSStatus carbonKeyboardHandler( // get the modifiers for any of the events GetEventParameter( event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &mods ); - if ( prevMods == 0xffffffff ) prevMods = mods; // get the key code only for key events UInt32 keyCode = 0; |
