diff options
| author | Manolo Gouy <Manolo> | 2010-05-26 21:25:11 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-05-26 21:25:11 +0000 |
| commit | 53d7a643f1a93842129e873b9a0d51f0006e0fcf (patch) | |
| tree | f61e3da4ac2a009131b829edee0c48df0c168da8 /src/Fl_get_key_mac.cxx | |
| parent | e2165ba02812e99dbd32c70cc6c11e2072a29ec0 (diff) | |
Fl_get_key_mac.cxx: removed GetKeys Carbon call
Tested OK with keyboard demo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_get_key_mac.cxx')
| -rw-r--r-- | src/Fl_get_key_mac.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Fl_get_key_mac.cxx b/src/Fl_get_key_mac.cxx index afdeddb7b..1d2db4a3f 100644 --- a/src/Fl_get_key_mac.cxx +++ b/src/Fl_get_key_mac.cxx @@ -87,6 +87,13 @@ int Fl::event_key(int k) { //: returns true, if that key is pressed right now int Fl::get_key(int k) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 + if(CGEventSourceKeyState != NULL) { + return (int)CGEventSourceKeyState(kCGEventSourceStateCombinedSessionState, fltk2mac(k) ); + } + else +#endif + { KeyMap foo; GetKeys(foo); #ifdef MAC_TEST_FOR_KEYCODES @@ -103,6 +110,7 @@ int Fl::get_key(int k) { } int i = fltk2mac(k); return (b[i>>3]>>(i&7))&1; + } } // |
