VirtualBox

Ticket #5764 (reopened defect)

Opened 4 years ago

Last modified 3 years ago

Arrow and other keys not working when starting with VBoxSDL => Fixed in SVN

Reported by: harmscon Owned by:
Priority: critical Component: other
Version: VirtualBox 3.1.0 Keywords: VBoxSDL arrow keys
Cc: Guest type: other
Host type: other

Description (last modified by frank) (diff)

Host: Ubuntu 9.10 32bit i386
Guest: Windows XP SP3 32bit i386
VirtualBox: 3.1

After upgrading the Host OS (from Ubuntu 8.04) the arrow keys, Home, End, Insert, PgUp, PgDwn, and / on the numeric keypad no longer work when starting the virtual machine with VBoxSDL.

The upgrade was an export VBox virtual machine, format hard drive, clean install new OS and then import the vbox Virtual machine.

I use the following command to start VirtualBox:

/usr/bin/gksudo -u fred 'VBoxSDL --startvm freds_VM --nofstoggle --termacpi'

After the upgrade mentioned above, the keyboard keys stopped working (sometimes the Start menu will open, other times it's like a right mouse click is pressed.)

If I start Virtual box like this:

/usr/bin/gksudo -u fred VBoxManage startvm freds_VM

all keys work as expected and as they always have, no matter which of these two methods I use to start the VM.

So this appears to be specific to VBoxSDL.

Attachments

VBox.log Download (51.7 KB) - added by harmscon 4 years ago.
VBoxSDL.cpp.cursorkeys.diff Download (622 bytes) - added by lsbz 3 years ago.
Vbox SDL frontend cursor keys patch

Change History

Changed 4 years ago by harmscon

comment:1 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to worksforme
  • Description modified (diff)

I'm quite sure your problems are gone when you append the --evdevkeymap switch to your VBoxSDL parameters.

comment:2 Changed 4 years ago by mpefra

  • Status changed from closed to reopened
  • Resolution worksforme deleted

Hello,

I have the same problem on a windows vista host. I tried option '--evdevkeymap' but this option doesn't exist (Version 3.1.6 r59338).

Any idea?

Thanks in advance.

comment:3 Changed 4 years ago by frank

That option does exist in VBox 3.1.6. What happens if you start your VM with

VBoxSDL --evdevkeymap --startvm VM_NAME

(replace VM_NAME with the name of a VM)?

comment:4 Changed 4 years ago by mpefra

It displays the usage message :

PS C:\Program Files\Sun\VirtualBox> & 'C:\Program Files\Sun\VirtualBox\VBoxSDL.exe' --evdevkeymap --startvm Debian
Sun VirtualBox SDL GUI version 3.1.6
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

Error: unrecognized switch '--evdevkeymap'
Usage:
 --startvm <uuid|name>    Virtual machine to start, either UUID or name
 --hda <file>             Set temporary first hard disk to file
 --fda <file>             Set temporary first floppy disk to file
.....

comment:5 Changed 4 years ago by frank

Which host is that?

comment:6 Changed 4 years ago by frank

Hmm, looks like this is a Windows host. The --evdevkeymap switch is only available for Linux hosts. Yours must be another issue then.

comment:7 Changed 4 years ago by mpefra

Yes it is a windows host (as mentionned in my first message). Do I have to create to create a new ticket?

comment:8 Changed 4 years ago by dreif

Hi,

I have a the same problem with VirtualBox 3.2.0 (ubuntu 10.4 host + ubuntu 9.10 guest). '--evdevkeymap' helps but the new command "VBoxManage --startvm uuid --type sdl" does not allows to pass this option.

I would use the VBoxSDL command, but since this release, VBoxSDL does not set the title attribute of the X windows anymore (tested with xlsclients command line util), which is a MUST in my integration setup. Actually I am stuck.

Regards, Frederic

comment:9 Changed 4 years ago by frank

  • Summary changed from Arrow and other keys not working when starting with VBoxSDL to Arrow and other keys not working when starting with VBoxSDL => Fixed in SVN

This will be fixed in the next maintenance release. VBoxSDL will inherit the keyboard handling from the Qt GUI.

comment:10 Changed 4 years ago by frank

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

comment:11 Changed 3 years ago by rbhkamal

  • Status changed from closed to reopened
  • Resolution fixed deleted

Did the fix go into the OSE? I'm still having the same exact problem with VirtualBox 3.2.12 OSE and 3.2.8 OSE (both self compiled)

Windows 7 32bit Guest: All operating systems have the problem

There are other strange issues with keyboard mapping, one user complained about the "\" key mapping to the "]" key... still investigating.

I tried to launch the same VM using VirtualBox.exe and the problem was NOT there, so there must be something wrong with vboxsdl.exe.

I also noticed that the first "UP Arrow" key works and prints "[[A" but the second and on print "8"

comment:12 Changed 3 years ago by rbhkamal

Sorry, the first up arrow key press prints the following:

^[[A

Then it starts printing the following:

8

VirtualBox is running on Windows 7 32bit

Guest machine is a debian linux 2.6 with Xorg 7.4

comment:13 Changed 3 years ago by lsbz

Below patch against 3.2.12 seems to work for Windows hosts.

--- VBoxSDL-org.cpp 2010-12-01 18:09:24 +0100 +++ VBoxSDL.cpp 2010-12-29 23:50:35 +0100 @@ -2919,7 +2919,7 @@

return (gfAbsoluteMouseHost && gfAbsoluteMouseGuest);

}

-#if defined(RT_OS_DARWIN) +#if defined(RT_OS_DARWIN)
defined(RT_OS_OS2)
defined(RT_OS_OS2) defined(RT_OS_WINDOWS)

/

  • Fallback keycode conversion using SDL symbols. *

@@ -3392,7 +3392,7 @@

RTPrintf("scancode=%#x -> %#x\n", ev->keysym.scancode, keycode);

#endif

-#elif RT_OS_OS2

+#elif defined(RT_OS_OS2)
defined(RT_OS_WINDOWS)

keycode = Keyevent2KeycodeFallback(ev);

#endif /* RT_OS_DARWIN */

return keycode;

Changed 3 years ago by lsbz

Vbox SDL frontend cursor keys patch

comment:14 Changed 3 years ago by rbhkamal

Verified that the fix works for the arrow keys. I tested on Windows 7 64bit with Linux 2.4 guest.

I know this is not the place to ask questions, but do you think this would fix the cases were the "\" key maps to the "]" key?

Thanks, RK

comment:15 Changed 3 years ago by lsbz

@rbhkamal:

Backslash '\' works OK on my keyboard in Win7 host and Fedora 14 guest. Maybe this is caused by a keyboard mapping in the guest?!

About the patch: it converts the SDL internal key codes back to "raw" key input for the guest. The source file has it prepared, but did not have it connected for Windows hosts.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use