xinput_wrapperplus

A wrapper for the Linux utility xinput. Publishes an SPS message whenever the super key is pressed as well as publishing a deciphered message when the control key is pressed more than once


License
MIT
Install
gem install xinput_wrapperplus -v 0.5.0

Documentation

Using XInputWrapperPlus to trigger upon a key press and more

Example

require "socket"
require 'xinput_wrapperplus'

hostname =  Socket.gethostname
keys = %i(control super f6)

xiw = XInputWrapperPlus.new topic: hostname + '/input', 
         lookup:  {105 => :control, 37 => :control, 134 => :super}, 
         host: 'sps.home', keys: keys
xiw.listen

The above example is intended to run in the background to listen for key presses or mouse movement. When either the ctrl key, super key (windows logo key), or F6 key is pressed a message is published to the SimplePubSub broker at sps.home on port 59000. In addition, it publishes the detection of any key or mouse movent to the broker, ever 30 seconds.

xinputwrapperplus xinput