0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper around uinput to create a virtual keyboard.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0

Runtime

 Project Readme

Uinput::Keyboard

Ruby wrapper around uinput to create a virtual keyboard from an xkb keymap.

Installation

Add this line to your application's Gemfile:

gem 'uinput-keyboard'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uinput-keyboard

Usage

require 'uinput/keyboard'

begin
    keymap = Uinput::Keyboard.keymap(rules: 'evdev', model: 'pc104', layout: 'de', variant: 'nodeadkeys')
    keyboard = Uinput::Keyboard.new(keymap)

    sleep 1 # to give linux time to setup the new device

    # While pasting this code into irb
    keyboard.type('Time.now')   # types 'Time.now'
    keyboard.tap(:Return)       # presses the Return key and returns the timestamp
ensure
    keyboard.destroy if keyboard
end