#!/usr/bin/python3 -su

## Copyright (C) 2019 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## https://forums.whonix.org/t/send-sysrq-commands-to-virtualbox-usability-helper-virtualbox-send-sysrq/8369

import subprocess
import sys

vmname = sys.argv[1]
key = sys.argv[2]

subprocess.call(['VBoxManage', 'controlvm', vmname, 'keyboardputscancode', '1d', '38', '54'])
subprocess.call(['VBoxManage', 'controlvm', vmname, 'keyboardputstring', key])
subprocess.call(['VBoxManage', 'controlvm', vmname, 'keyboardputscancode', 'd4', 'b8', '9d'])
