Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2015-05-17 16:43:42 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2015-05-17 17:55:18 +0300
commit43ee3f4040a41c637b6eceda4c3aa1046f8a13a5 (patch)
tree9194cbb4d14e55395f18a4cee612bf2ee9dc5f26 /source/blender/windowmanager/intern/wm_event_system.c
parent48ed2b63090b9108e5902a2d1382b8a54025c1c0 (diff)
Fix T44739: OS X RMB emulation giving wrong mouse button release event.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 42fc0267625..658fb317688 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2886,52 +2886,41 @@ static int convert_key(GHOST_TKey key)
static void wm_eventemulation(wmEvent *event)
{
- /* Store last mmb event value to make emulation work when modifier keys are released first. */
- static int mmb_emulated = 0; /* this should be in a data structure somwhere */
+ /* Store last mmb/rmb event value to make emulation work when modifier keys
+ * are released first. This really should be in a data structure somwhere. */
+ static int emulating_event = EVENT_NONE;
- /* middlemouse emulation */
+ /* middlemouse and rightmouse emulation */
if (U.flag & USER_TWOBUTTONMOUSE) {
if (event->type == LEFTMOUSE) {
if (event->val == KM_PRESS && event->alt) {
event->type = MIDDLEMOUSE;
event->alt = 0;
- mmb_emulated = 1;
+ emulating_event = MIDDLEMOUSE;
}
- else if (event->val == KM_RELEASE) {
- /* only send middle-mouse release if emulated */
- if (mmb_emulated) {
- event->type = MIDDLEMOUSE;
- event->alt = 0;
- }
- mmb_emulated = 0;
- }
- }
-
- }
-
#ifdef __APPLE__
-
- /* rightmouse emulation */
- if (U.flag & USER_TWOBUTTONMOUSE) {
- if (event->type == LEFTMOUSE) {
-
- if (event->val == KM_PRESS && event->oskey) {
+ else if (event->val == KM_PRESS && event->oskey) {
event->type = RIGHTMOUSE;
event->oskey = 0;
- mmb_emulated = 1;
+ emulating_event = RIGHTMOUSE;
}
+#endif
else if (event->val == KM_RELEASE) {
- if (mmb_emulated) {
- event->oskey = RIGHTMOUSE;
+ /* only send middle-mouse release if emulated */
+ if (emulating_event == MIDDLEMOUSE) {
+ event->type = MIDDLEMOUSE;
event->alt = 0;
}
- mmb_emulated = 0;
+ else if (emulating_event == RIGHTMOUSE) {
+ event->type = RIGHTMOUSE;
+ event->oskey = 0;
+ }
+ emulating_event = EVENT_NONE;
}
}
}
-#endif
/* numpad emulation */
if (U.flag & USER_NONUMPAD) {