What is the argument(s) to pass to `virsh send-key` to type an exclamation mark?
2/2
Jun 3, 8:31pm
To type an exclamation mark (!) using virsh send-key, you need to pass the keycode sequence for the Shift and 1 keys, as ! is typically produced by pressing Shift+1 on a standard keyboard.
Command:
bash
virsh send-key <domain> KEY_LEFT_SHIFT KEY_1
Replace <domain> with the name or ID of your virtual machine.
Explanation:
KEY_LEFT_SHIFT presses the left Shift key.
KEY_1 presses the 1 key.
Together, they produce !.
If you need to release the keys afterward, you can use:
The exact key names may vary slightly depending on your virsh version or keyboard layout. If KEY_LEFT_SHIFT doesn't work, try KEY_SHIFT or KEY_SHIFT_L.
For other special characters, you may need to combine modifier keys (e.g., Shift, Alt, Ctrl) with the base key.
Jun 3, 8:31pm
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.