Added support for JIS (Japanese) keyboards under Mac OS X.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9779 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2012-12-26 19:44:56 +00:00
parent 28a85d27e9
commit d879e4b2e8
2 changed files with 18 additions and 2 deletions

View File

@ -342,6 +342,10 @@ enum Fl_When { // Fl_Widget::when():
#define FL_Pause 0xff13 ///< The pause key. #define FL_Pause 0xff13 ///< The pause key.
#define FL_Scroll_Lock 0xff14 ///< The scroll lock key. #define FL_Scroll_Lock 0xff14 ///< The scroll lock key.
#define FL_Escape 0xff1b ///< The escape key. #define FL_Escape 0xff1b ///< The escape key.
#define FL_Kana 0xff2e ///< The Kana key of JIS keyboards.
#define FL_Eisu 0xff2f ///< The Eisu key of JIS keyboards.
#define FL_Yen 0xff30 ///< The Yen key of JIS keyboards.
#define FL_JIS_Underscore 0xff31 ///< The underscore key of JIS keyboards.
#define FL_Home 0xff50 ///< The home key. #define FL_Home 0xff50 ///< The home key.
#define FL_Left 0xff51 ///< The left arrow key. #define FL_Left 0xff51 ///< The left arrow key.
#define FL_Up 0xff52 ///< The up arrow key. #define FL_Up 0xff52 ///< The up arrow key.
@ -355,7 +359,7 @@ enum Fl_When { // Fl_Widget::when():
#define FL_Menu 0xff67 ///< The menu key. #define FL_Menu 0xff67 ///< The menu key.
#define FL_Help 0xff68 ///< The 'help' key on Mac keyboards #define FL_Help 0xff68 ///< The 'help' key on Mac keyboards
#define FL_Num_Lock 0xff7f ///< The num lock key. #define FL_Num_Lock 0xff7f ///< The num lock key.
#define FL_KP 0xff80 ///< One of the keypad numbers; use FL_KP + n for number n. #define FL_KP 0xff80 ///< One of the keypad numbers; use FL_KP + 'n' for digit n.
#define FL_KP_Enter 0xff8d ///< The enter key on the keypad, same as Fl_KP+'\\r'. #define FL_KP_Enter 0xff8d ///< The enter key on the keypad, same as Fl_KP+'\\r'.
#define FL_KP_Last 0xffbd ///< The last keypad key; use to range-check keypad. #define FL_KP_Last 0xffbd ///< The last keypad key; use to range-check keypad.
#define FL_F 0xffbd ///< One of the function keys; use FL_F + n for function key n. #define FL_F 0xffbd ///< One of the function keys; use FL_F + n for function key n.

View File

@ -164,6 +164,15 @@ enum {
kVK_ISO_Section = 0x0A kVK_ISO_Section = 0x0A
}; };
/* JIS keyboards only*/
enum {
kVK_JIS_Yen = 0x5D,
kVK_JIS_Underscore = 0x5E,
kVK_JIS_KeypadComma = 0x5F,
kVK_JIS_Eisu = 0x66,
kVK_JIS_Kana = 0x68
};
#endif #endif
// convert an FLTK (X) keysym to a MacOS symbol: // convert an FLTK (X) keysym to a MacOS symbol:
@ -182,11 +191,14 @@ static const struct {unsigned short vk, fltk;} vktab[] = {
{ kVK_ANSI_Y, 'Y' }, { kVK_ANSI_Z, 'Z' }, { kVK_ANSI_Y, 'Y' }, { kVK_ANSI_Z, 'Z' },
{ kVK_ANSI_LeftBracket, '[' }, { kVK_ANSI_Backslash, '\\' }, { kVK_ANSI_RightBracket, ']' }, { kVK_ANSI_Grave, '`' }, { kVK_ANSI_LeftBracket, '[' }, { kVK_ANSI_Backslash, '\\' }, { kVK_ANSI_RightBracket, ']' }, { kVK_ANSI_Grave, '`' },
{ kVK_Delete, FL_BackSpace }, { kVK_Tab, FL_Tab }, { kVK_ISO_Section, FL_Iso_Key }, { kVK_Return, FL_Enter }, /*{ 0x7F, FL_Pause }, { kVK_Delete, FL_BackSpace }, { kVK_Tab, FL_Tab }, { kVK_ISO_Section, FL_Iso_Key }, { kVK_Return, FL_Enter }, /*{ 0x7F, FL_Pause },
{ 0x7F, FL_Scroll_Lock },*/ { kVK_Escape, FL_Escape }, { kVK_Home, FL_Home }, { kVK_LeftArrow, FL_Left }, { 0x7F, FL_Scroll_Lock },*/ { kVK_Escape, FL_Escape },
{ kVK_JIS_Kana, FL_Kana}, { kVK_JIS_Eisu, FL_Eisu}, { kVK_JIS_Yen, FL_Yen}, { kVK_JIS_Underscore, FL_JIS_Underscore},
{ kVK_Home, FL_Home }, { kVK_LeftArrow, FL_Left },
{ kVK_UpArrow, FL_Up }, { kVK_RightArrow, FL_Right }, { kVK_DownArrow, FL_Down }, { kVK_PageUp, FL_Page_Up }, { kVK_UpArrow, FL_Up }, { kVK_RightArrow, FL_Right }, { kVK_DownArrow, FL_Down }, { kVK_PageUp, FL_Page_Up },
{ kVK_PageDown, FL_Page_Down }, { kVK_End, FL_End }, /*{ 0x7F, FL_Print }, { 0x7F, FL_Insert },*/ { kVK_PageDown, FL_Page_Down }, { kVK_End, FL_End }, /*{ 0x7F, FL_Print }, { 0x7F, FL_Insert },*/
{ 0x6e, FL_Menu }, { kVK_Help, FL_Help }, { kVK_ANSI_KeypadClear, FL_Num_Lock }, { 0x6e, FL_Menu }, { kVK_Help, FL_Help }, { kVK_ANSI_KeypadClear, FL_Num_Lock },
{ kVK_ANSI_KeypadEnter, FL_KP_Enter }, { kVK_ANSI_KeypadMultiply, FL_KP+'*' }, { kVK_ANSI_KeypadPlus, FL_KP+'+'}, { kVK_ANSI_KeypadEnter, FL_KP_Enter }, { kVK_ANSI_KeypadMultiply, FL_KP+'*' }, { kVK_ANSI_KeypadPlus, FL_KP+'+'},
{ kVK_JIS_KeypadComma, FL_KP+',' },
{ kVK_ANSI_KeypadMinus, FL_KP+'-' }, { kVK_ANSI_KeypadDecimal, FL_KP+'.' }, { kVK_ANSI_KeypadDivide, FL_KP+'/' }, { kVK_ANSI_KeypadMinus, FL_KP+'-' }, { kVK_ANSI_KeypadDecimal, FL_KP+'.' }, { kVK_ANSI_KeypadDivide, FL_KP+'/' },
{ kVK_ANSI_Keypad0, FL_KP+'0' }, { kVK_ANSI_Keypad1, FL_KP+'1' }, { kVK_ANSI_Keypad2, FL_KP+'2' }, { kVK_ANSI_Keypad3, FL_KP+'3' }, { kVK_ANSI_Keypad0, FL_KP+'0' }, { kVK_ANSI_Keypad1, FL_KP+'1' }, { kVK_ANSI_Keypad2, FL_KP+'2' }, { kVK_ANSI_Keypad3, FL_KP+'3' },
{ kVK_ANSI_Keypad4, FL_KP+'4' }, { kVK_ANSI_Keypad5, FL_KP+'5' }, { kVK_ANSI_Keypad6, FL_KP+'6' }, { kVK_ANSI_Keypad7, FL_KP+'7' }, { kVK_ANSI_Keypad4, FL_KP+'4' }, { kVK_ANSI_Keypad5, FL_KP+'5' }, { kVK_ANSI_Keypad6, FL_KP+'6' }, { kVK_ANSI_Keypad7, FL_KP+'7' },