summaryrefslogtreecommitdiff
path: root/src/Fl_get_key_mac.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-01-03 16:50:34 +0000
committerManolo Gouy <Manolo>2011-01-03 16:50:34 +0000
commit874bca74f55f686ded8f0b3d2df08196911f26f0 (patch)
treef1d394945f49314ee4a8706a4b98daf8ec830ce8 /src/Fl_get_key_mac.cxx
parentbb6392f7ec94ba682ebade1d5b30eba9ff30ceb1 (diff)
Mac OS X: removed all uses of Carbon (except for older OS versions) and re-organized
text input around the NSTextInput protocol. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8173 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_get_key_mac.cxx')
-rw-r--r--src/Fl_get_key_mac.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Fl_get_key_mac.cxx b/src/Fl_get_key_mac.cxx
index 7f3c7a227..126b17806 100644
--- a/src/Fl_get_key_mac.cxx
+++ b/src/Fl_get_key_mac.cxx
@@ -83,8 +83,6 @@ int Fl::event_key(int k) {
return get_key(k);
}
-#include <stdio.h>
-
//: 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
@@ -94,8 +92,13 @@ int Fl::get_key(int k) {
else
#endif
{
- KeyMap foo;
- GetKeys(foo);
+ typedef UInt32 fl_KeyMap[4];
+ fl_KeyMap foo;
+ // use the GetKeys Carbon function
+ typedef void (*keymap_f)(fl_KeyMap);
+ static keymap_f f = NULL;
+ if (!f) f = ( keymap_f )Fl_X::get_carbon_function("GetKeys");
+ (*f)(foo);
#ifdef MAC_TEST_FOR_KEYCODES
static int cnt = 0;
if (cnt++>1024) {