|
|
@ -58,11 +58,28 @@ enum RightMouseButtonEmulationState {
|
|
|
|
static unsigned int _current_mods;
|
|
|
|
static unsigned int _current_mods;
|
|
|
|
static bool _tab_is_down;
|
|
|
|
static bool _tab_is_down;
|
|
|
|
static bool _emulating_right_button;
|
|
|
|
static bool _emulating_right_button;
|
|
|
|
|
|
|
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
|
|
|
|
|
|
static float _current_magnification;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#ifdef _DEBUG
|
|
|
|
static uint32 _tEvent;
|
|
|
|
static uint32 _tEvent;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Support for touch gestures is only available starting with the
|
|
|
|
|
|
|
|
* 10.6 SDK, even if it says that support starts in fact with 10.5.2.
|
|
|
|
|
|
|
|
* Replicate the needed stuff for older SDKs. */
|
|
|
|
|
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5
|
|
|
|
|
|
|
|
static const NSUInteger NSEventTypeMagnify = 30;
|
|
|
|
|
|
|
|
static const NSUInteger NSEventTypeEndGesture = 20;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface NSEvent ()
|
|
|
|
|
|
|
|
/* This message is valid for events of type NSEventTypeMagnify, on 10.5.2 or later */
|
|
|
|
|
|
|
|
- (CGFloat)magnification WEAK_IMPORT_ATTRIBUTE;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint32 GetTick()
|
|
|
|
static uint32 GetTick()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct timeval tim;
|
|
|
|
struct timeval tim;
|
|
|
@ -542,6 +559,29 @@ static bool QZ_PollEvent()
|
|
|
|
_cursor.v_wheel -= (int)([ event deltaY ] * 5 * _settings_client.gui.scrollwheel_multiplier);
|
|
|
|
_cursor.v_wheel -= (int)([ event deltaY ] * 5 * _settings_client.gui.scrollwheel_multiplier);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
|
|
|
|
|
|
case NSEventTypeMagnify:
|
|
|
|
|
|
|
|
/* Pinch open or close gesture. */
|
|
|
|
|
|
|
|
_current_magnification += [ event magnification ] * 5.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (_current_magnification >= 1.0f) {
|
|
|
|
|
|
|
|
_current_magnification -= 1.0f;
|
|
|
|
|
|
|
|
_cursor.wheel++;
|
|
|
|
|
|
|
|
HandleMouseEvents();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
while (_current_magnification <= -1.0f) {
|
|
|
|
|
|
|
|
_current_magnification += 1.0f;
|
|
|
|
|
|
|
|
_cursor.wheel--;
|
|
|
|
|
|
|
|
HandleMouseEvents();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case NSEventTypeEndGesture:
|
|
|
|
|
|
|
|
/* Gesture ended. */
|
|
|
|
|
|
|
|
_current_magnification = 0.0f;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
case NSCursorUpdate:
|
|
|
|
case NSCursorUpdate:
|
|
|
|
case NSMouseEntered:
|
|
|
|
case NSMouseEntered:
|
|
|
|
case NSMouseExited:
|
|
|
|
case NSMouseExited:
|
|
|
|