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
keyboard.type('Time.now')
keyboard.tap(:Return)
ensure
keyboard.destroy if keyboard
end