Skip to content

Commit

Permalink
Fl_get_key_mac.cxx: removed GetKeys Carbon call
Browse files Browse the repository at this point in the history
Tested OK with keyboard demo.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed May 26, 2010
1 parent e2165ba commit 53d7a64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fl_cocoa.mm
Expand Up @@ -43,7 +43,7 @@
really remove these as well, so we can stop linking to Carbon alltogether.
"_GetKeys", referenced from:
Fl::get_key(int) in Fl_get_key.o
Fl::get_key(int) in Fl_get_key.o (kept only for pre-10.4 runs)
"_GetEventParameter", referenced from:
carbonTextHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in Fl.o
Expand Down
8 changes: 8 additions & 0 deletions src/Fl_get_key_mac.cxx
Expand Up @@ -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
Expand All @@ -103,6 +110,7 @@ int Fl::get_key(int k) {
}
int i = fltk2mac(k);
return (b[i>>3]>>(i&7))&1;
}
}

//
Expand Down

0 comments on commit 53d7a64

Please sign in to comment.