Author: manolo
Date: 2012-12-26 11:58:31 -0800 (Wed, 26 Dec 2012)
New Revision: 9780
Log:
Added support for JIS (Japanese) keyboards under Mac OS X.

Modified:
   branches/branch-3.0/include/fltk3/enumerations.h
   branches/branch-3.0/src/fltk3/cocoa_get_key.cxx

Modified: branches/branch-3.0/include/fltk3/enumerations.h
===================================================================
--- branches/branch-3.0/include/fltk3/enumerations.h    2012-12-26 19:44:56 UTC 
(rev 9779)
+++ branches/branch-3.0/include/fltk3/enumerations.h    2012-12-26 19:58:31 UTC 
(rev 9780)
@@ -340,37 +340,41 @@
   
   // FIXME: These codes collide with valid Unicode keys
   
-  const unsigned int MouseButton       = 0xfee8;       ///< A mouse button; 
use fltk3::Button + n for mouse button n.
-  const unsigned int BackSpaceKey      = 0xff08;       ///< The backspace key.
+  const unsigned int MouseButton = 0xfee8;     ///< A mouse button; use 
fltk3::Button + n for mouse button n.
+  const unsigned int BackSpaceKey = 0xff08;    ///< The backspace key.
   const unsigned int TabKey    = 0xff09;       ///< The tab key.
   const unsigned int IsoKey    = 0xff0c;       ///< The additional key of ISO 
keyboards.
   const unsigned int EnterKey  = 0xff0d;       ///< The enter key. 
   const unsigned int PauseKey  = 0xff13;       ///< The pause key.
   const unsigned int ScrollLockKey= 0xff14;    ///< The scroll lock key.
   const unsigned int EscapeKey = 0xff1b;       ///< The escape key.
+  const unsigned int KanaKey    = 0xff2e;       ///< The Kana key of JIS 
keyboards.
+  const unsigned int EisuKey    = 0xff2f;       ///< The Eisu key of JIS 
keyboards.
+  const unsigned int YenKey     = 0xff30;       ///< The Yen key of JIS 
keyboards.
+  const unsigned int JISUnderscoreKey = 0xff31; ///< The underscore key of JIS 
keyboards.
   const unsigned int HomeKey   = 0xff50;       ///< The home key.
   const unsigned int LeftKey   = 0xff51;       ///< The left arrow key.
-  const unsigned int UpKey             = 0xff52;       ///< The up arrow key.
+  const unsigned int UpKey     = 0xff52;       ///< The up arrow key.
   const unsigned int RightKey  = 0xff53;       ///< The right arrow key.
   const unsigned int DownKey   = 0xff54;       ///< The down arrow key.
   const unsigned int PageUpKey = 0xff55;       ///< The page-up key.
-  const unsigned int PageDownKey       = 0xff56;       ///< The page-down key.
+  const unsigned int PageDownKey = 0xff56;     ///< The page-down key.
   const unsigned int EndKey    = 0xff57;       ///< The end key.
   const unsigned int PrintKey  = 0xff61;       ///< The print (or 
print-screen) key.
   const unsigned int InsertKey = 0xff63;       ///< The insert key. 
   const unsigned int MenuKey   = 0xff67;       ///< The menu key.
   const unsigned int HelpKey   = 0xff68;       ///< The 'help' key on Mac 
keyboards
   const unsigned int NumLockKey        = 0xff7f;       ///< The num lock key.
-  const unsigned int KPKey             = 0xff80;       ///< One of the keypad 
numbers; use fltk3::KPKey + n for number n.
+  const unsigned int KPKey     = 0xff80;       ///< One of the keypad numbers; 
use fltk3::KPKey + 'n' for digit n.
   const unsigned int KPEnterKey        = 0xff8d;       ///< The enter key on 
the keypad, same as fltk3::KPKey+'\\r'.
   const unsigned int KPLastKey = 0xffbd;       ///< The last keypad key; use 
to range-check keypad.
-  const unsigned int FKey              = 0xffbd;       ///< One of the 
function keys; use fltk3::FKey + n for function key n.
+  const unsigned int FKey      = 0xffbd;       ///< One of the function keys; 
use fltk3::FKey + n for function key n.
   const unsigned int FLastKey  = 0xffe0;       ///< The last function key; use 
to range-check function keys.
   const unsigned int ShiftLKey = 0xffe1;       ///< The lefthand shift key.
   const unsigned int ShiftRKey = 0xffe2;       ///< The righthand shift key.
-  const unsigned int ControlLKey       = 0xffe3;       ///< The lefthand 
control key.
-  const unsigned int ControlRKey       = 0xffe4;       ///< The righthand 
control key.
-  const unsigned int CapsLockKey       = 0xffe5;       ///< The caps lock key.
+  const unsigned int ControlLKey = 0xffe3;     ///< The lefthand control key.
+  const unsigned int ControlRKey = 0xffe4;     ///< The righthand control key.
+  const unsigned int CapsLockKey = 0xffe5;     ///< The caps lock key.
   const unsigned int MetaLKey  = 0xffe7;       ///< The left meta/Windows key.
   const unsigned int MetaRKey  = 0xffe8;       ///< The right meta/Windows key.
   const unsigned int AltLKey   = 0xffe9;       ///< The left alt key.

Modified: branches/branch-3.0/src/fltk3/cocoa_get_key.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa_get_key.cxx     2012-12-26 19:44:56 UTC 
(rev 9779)
+++ branches/branch-3.0/src/fltk3/cocoa_get_key.cxx     2012-12-26 19:58:31 UTC 
(rev 9780)
@@ -173,6 +173,15 @@
   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
 
 // convert an FLTK (X) keysym to a MacOS symbol:
@@ -191,11 +200,14 @@
   { kVK_ANSI_Y, 'Y' }, {  kVK_ANSI_Z, 'Z'  }, 
   { kVK_ANSI_LeftBracket, '[' }, { kVK_ANSI_Backslash, '\\' },{ 
kVK_ANSI_RightBracket, ']' }, { kVK_ANSI_Grave, '`' }, 
   { kVK_Delete, fltk3::BackSpaceKey }, { kVK_Tab, fltk3::TabKey }, { 
kVK_ISO_Section, fltk3::IsoKey }, { kVK_Return, fltk3::EnterKey }, /*{ 0x7F, 
fltk3::PauseKey },
-  { 0x7F, fltk3::ScrollLockKey },*/ { kVK_Escape, fltk3::EscapeKey }, { 
kVK_Home, fltk3::HomeKey }, { kVK_LeftArrow, fltk3::LeftKey },
+  { 0x7F, fltk3::ScrollLockKey },*/ { kVK_Escape, fltk3::EscapeKey },
+  { kVK_JIS_Kana, fltk3::KanaKey}, { kVK_JIS_Eisu, fltk3::EisuKey}, { 
kVK_JIS_Yen, fltk3::YenKey}, { kVK_JIS_Underscore, fltk3::JISUnderscoreKey},
+  { kVK_Home, fltk3::HomeKey }, { kVK_LeftArrow, fltk3::LeftKey },
   { kVK_UpArrow, fltk3::UpKey }, { kVK_RightArrow, fltk3::RightKey }, { 
kVK_DownArrow, fltk3::DownKey }, { kVK_PageUp, fltk3::PageUpKey },
   { kVK_PageDown, fltk3::PageDownKey },  { kVK_End, fltk3::EndKey }, /*{ 0x7F, 
fltk3::PrintKey }, { 0x7F, fltk3::InsertKey },*/
   { 0x6e, fltk3::MenuKey }, { kVK_Help, fltk3::HelpKey }, { 
kVK_ANSI_KeypadClear, fltk3::NumLockKey },
   { kVK_ANSI_KeypadEnter, fltk3::KPEnterKey }, { kVK_ANSI_KeypadMultiply, 
fltk3::KPKey+'*' }, { kVK_ANSI_KeypadPlus, fltk3::KPKey+'+'}, 
+  { kVK_JIS_KeypadComma, fltk3::KPKey+',' },
   { kVK_ANSI_KeypadMinus, fltk3::KPKey+'-' }, { kVK_ANSI_KeypadDecimal, 
fltk3::KPKey+'.' }, { kVK_ANSI_KeypadDivide, fltk3::KPKey+'/' }, 
   { kVK_ANSI_Keypad0, fltk3::KPKey+'0' }, { kVK_ANSI_Keypad1, fltk3::KPKey+'1' 
}, { kVK_ANSI_Keypad2, fltk3::KPKey+'2' }, { kVK_ANSI_Keypad3, fltk3::KPKey+'3' 
}, 
   { kVK_ANSI_Keypad4, fltk3::KPKey+'4' }, { kVK_ANSI_Keypad5, fltk3::KPKey+'5' 
}, { kVK_ANSI_Keypad6, fltk3::KPKey+'6' }, { kVK_ANSI_Keypad7, fltk3::KPKey+'7' 
}, 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to