OS X: fixed handling of the KP_Enter key which is at different key codes for the Powerbook vs. Desktop machines.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5182 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
abd221aa56
commit
d2f9ebf9b9
@ -96,8 +96,12 @@ int Fl::get_key(int k) {
|
||||
printf("%08x %08x %08x %08x\n", (ulong*)(foo)[3], (ulong*)(foo)[2], (ulong*)(foo)[1], (ulong*)(foo)[0]);
|
||||
}
|
||||
#endif
|
||||
int i = fltk2mac(k);
|
||||
unsigned char *b = (unsigned char*)foo;
|
||||
// KP_Enter can be at different locations for Powerbooks vs. desktop Macs
|
||||
if (k==FL_KP_Enter) {
|
||||
return (((b[0x34>>3]>>(0x34&7))&1)||((b[0x4c>>3]>>(0x4c&7))&1));
|
||||
}
|
||||
int i = fltk2mac(k);
|
||||
return (b[i>>3]>>(i&7))&1;
|
||||
}
|
||||
|
||||
|
@ -129,8 +129,10 @@ static unsigned short macKeyLookUp[128] =
|
||||
'u', '[', 'i', 'p', FL_Enter, 'l', 'j', '\'',
|
||||
'k', ';', '\\', ',', '/', 'n', 'm', '.',
|
||||
|
||||
FL_Tab, ' ', '`', FL_BackSpace, 0/*kp_enter on powerbook G4*/, FL_Escape, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
FL_Tab, ' ', '`', FL_BackSpace,
|
||||
FL_KP_Enter, FL_Escape, 0, 0/*FL_Meta_L*/,
|
||||
0/*FL_Shift_L*/, 0/*FL_Caps_Lock*/, 0/*FL_Alt_L*/, 0/*FL_Control_L*/,
|
||||
0/*FL_Shift_R*/, 0/*FL_Alt_R*/, 0/*FL_Control_R*/, 0,
|
||||
|
||||
0, FL_KP+'.', FL_Right, FL_KP+'*', 0, FL_KP+'+', FL_Left, FL_Num_Lock,
|
||||
FL_Down, 0, 0, FL_KP+'/', FL_KP_Enter, FL_Up, FL_KP+'-', 0,
|
||||
@ -139,10 +141,10 @@ static unsigned short macKeyLookUp[128] =
|
||||
FL_KP+'6', FL_KP+'7', 0, FL_KP+'8', FL_KP+'9', 0, 0, 0,
|
||||
|
||||
FL_F+5, FL_F+6, FL_F+7, FL_F+3, FL_F+8, FL_F+9, 0, FL_F+11,
|
||||
0, 0, FL_Print, FL_Scroll_Lock, 0, FL_F+10, FL_Menu, FL_F+12,
|
||||
0, 0/*FL_F+13*/, FL_Print, FL_Scroll_Lock, 0, FL_F+10, FL_Menu, FL_F+12,
|
||||
|
||||
0, FL_Pause, FL_Help, FL_Home, FL_Page_Up, FL_Delete, FL_F+4, FL_End,
|
||||
FL_F+2, FL_Page_Down, FL_F+1, FL_Left, FL_Right, FL_Down, FL_Up, 0,
|
||||
FL_F+2, FL_Page_Down, FL_F+1, FL_Left, FL_Right, FL_Down, FL_Up, 0/*FL_Power*/,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1107,7 +1109,8 @@ pascal OSStatus carbonKeyboardHandler(
|
||||
else
|
||||
sym = macKeyLookUp[ keyCode & 0x7f ];
|
||||
Fl::e_keysym = sym;
|
||||
if ( keyCode==0x4c ) key=0x0d;
|
||||
// Handle FL_KP_Enter on regular keyboards and on Powerbooks
|
||||
if ( keyCode==0x4c || keyCode==0x34) key=0x0d;
|
||||
// Matt: the Mac has no concept of a NumLock key, or at least not visible
|
||||
// Matt: to Carbon. The kEventKeyModifierNumLockMask is only set when
|
||||
// Matt: a numeric keypad key is pressed and does not correspond with
|
||||
|
Loading…
Reference in New Issue
Block a user