What is the argument(s) to pass to `virsh send-key` to type an exclamation mark to a French layout keyboard guest?
Jun 3, 8:34pm

To type an exclamation mark (!) on a French AZERTY keyboard layout using virsh send-key, you need to account for the fact that the ! character is produced by pressing Shift + 1 (the 1 key is located where the & is on a QWERTY keyboard).

Correct Argument for virsh send-key:

The virsh send-key command expects keysyms (X11 keysym names) or scancodes. For a French AZERTY layout, the ! is generated by:

  • Shift_L + 1 (or Shift_R + 1).

Command:

bash
virsh send-key <domain> KEY_LEFTSHIFT KEY_1

or

bash
virsh send-key <domain> KEY_RIGHTSHIFT KEY_1

Explanation:

  • KEY_LEFTSHIFT or KEY_RIGHTSHIFT simulates pressing the Shift key.
  • KEY_1 simulates pressing the 1 key (which, when combined with Shift, produces ! on AZERTY).

Alternative: Using X11 Keysyms

If your virsh version supports X11 keysyms, you can also use:

bash
virsh send-key <domain> XF86_Ungrab KEY_EXCLAM

But KEY_LEFTSHIFT KEY_1 is the most reliable method for AZERTY.

Jun 3, 8:34pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more