Ask Your Question

virsh - what are the key names?

asked 2012-04-29 09:43:30 -0500

amturnip gravatar image

I want to send the Windows and Menu keys to the guest. According to help, virsh send-key can send keys by symbolic name. Where can I find the key names that virsh accepts?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-05-18 11:57:50 -0500

thm gravatar image

updated 2016-08-22 03:30:10 -0500

virsh send-key expects keys as symbolic names or numeric values for a certain codeset. The standard codeset is linux, but this can be changed with the --codeset option.

Now, the list of keys that is accepted by virsh send-key is generated at build time from the source file src/util/keymaps.csv (download).

Looking at this table you can see that the left and right windows keys can be sent e.g. using the win32 codeset and symbolic names VK_LWIN and VK_RWIN, respectively. Or you could use KEY_LEFTMETA and KEY_RIGHTMETA in the (standard) linux codeset. The Menu key is (iiuc) named KEY_COMPOSE (linux) resp. VK_APPS (win32).

Other sources of information are /usr/include/linux/input.h, for linux symbolic names, and tables like this one, for win symbolic names.

edit flag offensive delete link more

Question Tools


Asked: 2012-04-29 09:43:30 -0500

Seen: 2,310 times

Last updated: Aug 22 '16