Skip to content

a tool detect (at background, ubuntu) keyevent & run cmd //virtualbox switch workspace even in virtual machine, without host key

Notifications You must be signed in to change notification settings

yurenchen000/keyevent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keyevent @ubuntu

a tool detect (at background, ubuntu) keyevent & run cmd.

on ubuntu
when vbox get focus, can't use Ctrl+Alt+Left to switch workspace.

this daemon tool, as one workaround:

  • detect keyevent, then:
    • run cmd to switch workspace // depend xdotool

ref: https://superuser.com/questions/108785/getting-host-to-capture-certain-key-presses-in-virtualbox/1611071

1. choice eventX

ls -lh /dev/input/event*

//a. use evtest

sudo evtest

//b. use xinput // it has different device num , not need root (through x input)

xinput list 
# not need root
xinput test 18

//b. use scan.sh

a script to scan all event*

sudo ./scan.sh

Ctrl+C or Enter to exit.

// assume input device is /dev/input/event18

2. run keyevent

sudo ./keyevent /dev/input/event18

3. run background

# start
INPUT=/dev/input/event18 ./key-vbox.sh start

# stop
key-vbox.sh stop

X. use scan_run.sh

this script do step 1. & 3. works in one step automatically.


note: get key event on ubuntu

Get key event on host ubuntu at low-level
// use tools such as showkey, evtest, or getevent

  • evtest, getevent (should specify input device),
    // depend on /dev/input/eventX, need root
  • showkey not depend on input device (all keyboard are same),
    // depend on /dev/console, need root
  • xinput test (should specify device, not same with /dev/input/eventX)
    // depend on X system, not need root

About

a tool detect (at background, ubuntu) keyevent & run cmd //virtualbox switch workspace even in virtual machine, without host key

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published