VirtualBox

Ticket #1766 (reopened defect)

Opened 8 years ago

Last modified 5 weeks ago

ctrl key on OS X is not usable

Reported by: clf Owned by:
Priority: major Component: GUI
Version: VirtualBox 1.6.2 Keywords: ctrl click context menu
Cc: Guest type: other
Host type: Mac OS X

Description

When using an OS X host, the control (ctrl) + mouse press key combination is not recognized correctly. Ctrl + left click results in a right-click, which means that selecting multiple items by ctrl-clicking on files, etc. is not possible. Using ctrl-click as a command (to open links in tabs in a browser, for example) is also affected by this, as ctrl opens a context menu. In many cases this makes typical tasks impossible or frustrating in the guest OS.

Change History

comment:1 Changed 8 years ago by frank

  • Host type changed from other to Mac OS X
  • Component changed from other to GUI

comment:2 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Please reopen if still relevant with VBox 4.3.2.

comment:3 Changed 15 months ago by meon

  • Status changed from closed to reopened
  • Resolution fixed deleted

Having the same issue as in this ticket (#1766) after upgrading to VBox 4.3.28 r100309

Host: Mac OS 10.9.5 Guest OS: Windows XP/Windows 8

The problem occurs when Mouse Integration is enabled. When I hold Ctrl and left-click the mouse (and slightly move the mouse) this results in right-clicking the mouse (I get context menu displayed)

When I Disable Mouse Integration, mouse works as it should.

comment:4 Changed 15 months ago by frank

meon, which host key did you select?

comment:5 Changed 15 months ago by meon

Host key is left 'Apple Key'... the default

comment:6 follow-up: ↓ 7 Changed 7 weeks ago by mooflu

It's still broken in 5.1.2 r108956 (tried on OSX with Linux guest). As mentioned by meon, broken since 4.3.28.

Note:  https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/libx11-ddefs.html #define ShiftMask (1<<0) #define ControlMask (1<<2) #define Button1Mask (1<<8) #define Button3Mask (1<<10)

Test with xev:

Incorrect events for ctrl+left MB (note state is 0x4 (press) 0x404 (release WRONG) - should be 0x4 and 0x104) ctrl+left MB, then ctrl+middle MB, then ctrl+right MB:

KeyPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11086089, (89,79), root:(468,583), state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11087521, (89,79), root:(468,583), state 0x4, button 3, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11087736, (89,79), root:(468,583), state 0x404, button 3, same_screen YES

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11088480, (88,79), root:(467,583), state 0x4, button 2, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11088792, (88,79), root:(467,583), state 0x204, button 2, same_screen YES

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11089448, (89,79), root:(468,583), state 0x4, button 3, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11089648, (89,79), root:(468,583), state 0x404, button 3, same_screen YES

KeyRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 11090961, (89,79), root:(468,583), state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

For comparison: correct events for shift+MB shift+left MB, then shift+middle MB, then shift+right MB:

KeyPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10950625, (89,79), root:(519,496), state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10951761, (89,79), root:(519,496), state 0x1, button 1, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10952136, (89,79), root:(519,496), state 0x101, button 1, same_screen YES

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10953472, (89,78), root:(519,495), state 0x1, button 2, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10953864, (89,78), root:(519,495), state 0x201, button 2, same_screen YES

ButtonPress event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10954864, (89,79), root:(519,496), state 0x1, button 3, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10955192, (89,79), root:(519,496), state 0x401, button 3, same_screen YES

KeyRelease event, serial 37, synthetic NO, window 0x3800001,

root 0x17b, subw 0x0, time 10957361, (89,79), root:(519,496), state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

Last edited 7 weeks ago by mooflu (previous) (diff)

comment:7 in reply to: ↑ 6 Changed 7 weeks ago by socratis

Replying to mooflu:

As mentioned by meon, broken since 4.3.28.

Just one small correction. It is not broken since 4.3.28. This is a 5.1.x regression. It works fine with 5.0.26 and all the 5.0.x series. I think it might have to do with either the Qt5 or that they changed the compiler used for the 5.1.x series.

Or something totally unrelated.

comment:8 Changed 7 weeks ago by mooflu

Ok, thanks for the correction.

Not sure if this narrows it down further, but when I run it with VBOX_RELEASE_LOG=+main.e.l3:

ctrl+left MB

00:01:53.820827 virtual nsresult Mouse::putMouseEventAbsolute(PRInt32, PRInt32, PRInt32, PRInt32, PRInt32): x=135, y=533, dz=0, dw=0, fButtons=0x2

just left MB:

00:01:52.961004 virtual nsresult Mouse::putMouseEventAbsolute(PRInt32, PRInt32, PRInt32, PRInt32, PRInt32): x=135, y=533, dz=0, dw=0, fButtons=0x1

comment:9 Changed 7 weeks ago by mooflu

So I guess this gets triggered in src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

#ifdef VBOX_WS_MAC
    /* Simulate the right click on host-key + left-mouse-button: */
    if (machineLogic()->keyboardHandler()->isHostKeyPressed() &&
        machineLogic()->keyboardHandler()->isHostKeyAlone() &&
        iMouseButtonsState == KMouseButtonState_LeftButton)
        iMouseButtonsState = KMouseButtonState_RightButton;
#endif /* VBOX_WS_MAC */

My host-key is the default (I believe) and set to left ⌘ (command)

Same behaviour when I change host-key to left ⌥ (option) Tried some other host-keys as well, but (left or right) ctrl+ left MB always results in right MB no matter what the host key is configured as.

comment:10 Changed 7 weeks ago by jeusername

If you have 3 finger drag enabled on the OS X host (accessibility preferences), you can use small 3-finger-drags over each item as a painful workaround to multi-select on a windows guest with mouse integration enabled. This will select the item *and* activate the context menu.

comment:11 Changed 6 weeks ago by AlexHieu

Having the same issue as in this ticket (#1766) after upgrading to VBox 5.1.4 r110228 (already installed VboxGuestAddition)

Host: Mac OS 10.11.6 Guest OS: Windows 7 (64bit)

The problem occurs when Mouse Integration is enabled. When I hold Ctrl and left-click the mouse (and slightly move the mouse) this results in right-clicking the mouse (I get context menu displayed)

When I Disable Mouse Integration, the mouse works as it should.

comment:12 Changed 5 weeks ago by aim

Having the same issue as in this ticket (#1766) after upgrading to VBox 5.1.4 r110228 (already installed VboxGuestAddition)

Host: Mac OS 10.11.6 Guest OS: Arch Linux (32bit)

The problem occurs when Mouse Integration is enabled. When I hold Ctrl and left-click the mouse (and slightly move the mouse) this results in right-clicking the mouse (I get context menu displayed)

When I Disable Mouse Integration, the mouse works as it should.

It works fine with 5.0.26 and all the 5.0.x series.

comment:13 Changed 5 weeks ago by VKH

Having the same issue as in this ticket (#1766) after upgrading to VBox 5.1.x (already installed VboxGuestAddition)

Host: Mac OS 10.11.6 Guest OS: Windows 10 (64bit)

As described above, the problem occurs when Mouse Integration is enabled. When I hold Ctrl and left-click the mouse this results in right-clicking the mouse (I get context menu displayed). Previous reports say that this must coincide witha slight movement of the mouse. I cannot confirm whether the mouse is moving as I am trying not to move it as I press the left mouse button, but it could be moving ever so slightly.

When I Disable Mouse Integration, the mouse works as it should.

It worked fine with all the 5.0.x series.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use