Page 1 of 1

Cannot send an & key

PostPosted: 26. Jun 2018, 13:11
by petra
Hello,
I'm using the API to send some key strokes to my VM, for example:
Code: Select all   Expand viewCollapse view
session.console.keyboard.put_keys("Hello World!")

It works fine and I see the message on a cmd.exe window on the guest machine.
However, I have 3 problems:
1. { is sent as }
2. } is sent as {
3. & is sent as ^ (^ is also ^, so I cannot send & actually)

Any idea how to send an & to my guest?

Re: Cannot send an & key

PostPosted: 26. Jun 2018, 16:12
by mpack
Send the right scancode. Look up the scancode equivalents for your host keyboard layout and the layout the guest OS is configured for.

This data is being passed through a simulated keyboard, i.e. as scancodes, not as ASCII strings.

I have no use for the API myself. Does that function send separate keydown and keyup events for each character in the string? I guess it must.

Re: Cannot send an & key

PostPosted: 26. Jun 2018, 21:07
by socratis
Why can't I find a single reference of "put_keys" in the source code or the SDK?

Re: Cannot send an & key

PostPosted: 27. Jun 2018, 10:27
by petra
Method put_keys is documented at:

https://media.readthedocs.org/pdf/pyvbox/latest/pyvbox.pdf

Let me check the scancodes.

Re: Cannot send an & key

PostPosted: 27. Jun 2018, 10:55
by socratis
Oh, so it's not a native VirtualBox API call! Maybe you should ask for help also in the "pyvbox" project?