Coder Social home page Coder Social logo

yurenchen000 / keyevent Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 26 KB

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

C 86.86% Shell 13.14%
ubuntu utils virtualbox

keyevent's Introduction

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

keyevent's People

Contributors

yurenchen000 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.