< prev index next >
src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
Print this page
*** 65,74 ****
--- 65,75 ----
// Apparently, for mouse up/down events we have to set an event number
// that is incremented on each button press. Otherwise, strange things
// happen with z-order.
static int gsEventNumber;
static int* gsButtonEventNumber;
+ static CRobotKeyCodeMapping *keyCodeMapping;
static inline CGKeyCode GetCGKeyCode(jint javaKeyCode);
static void PostMouseEvent(const CGPoint point, CGMouseButton button,
CGEventType type, int clickCount, int eventNumber);
*** 128,137 ****
--- 129,139 ----
for (i = 0; i < gNumberOfButtons; ++i) {
gsButtonEventNumber[i] = ROBOT_EVENT_NUMBER_START;
}
}
+ keyCodeMapping = [CRobotKeyCodeMapping sharedInstance];
}
/*
* Class: sun_lwawt_macosx_CRobot
* Method: mouseEvent
*** 342,353 ****
}
}
static inline CGKeyCode GetCGKeyCode(jint javaKeyCode)
{
! CRobotKeyCodeMapping *keyCodeMapping = [CRobotKeyCodeMapping sharedInstance];
return [keyCodeMapping getOSXKeyCodeForJavaKey:javaKeyCode];
}
static int GetClickCount(BOOL isDown) {
NSTimeInterval now = [[NSDate date] timeIntervalSinceReferenceDate];
NSTimeInterval clickInterval = now - gsLastClickTime;
--- 344,357 ----
}
}
static inline CGKeyCode GetCGKeyCode(jint javaKeyCode)
{
! if (keyCodeMapping) {
return [keyCodeMapping getOSXKeyCodeForJavaKey:javaKeyCode];
+ }
+ return OSX_Undefined;
}
static int GetClickCount(BOOL isDown) {
NSTimeInterval now = [[NSDate date] timeIntervalSinceReferenceDate];
NSTimeInterval clickInterval = now - gsLastClickTime;
< prev index next >