Class: Delirium::Platform::Linux::Keyboard

Inherits:
Base::Keyboard show all
Defined in:
lib/delirium/platform/linux/keyboard.rb

Instance Method Summary collapse

Instance Method Details

#key_down(key:) ⇒ Object



12
13
14
15
16
17
# File 'lib/delirium/platform/linux/keyboard.rb', line 12

def key_down(key:)
  case key
  when Symbol
    `xdotool keydown '#{key}'`
  end
end

#key_press(key:) ⇒ Object



5
6
7
8
9
10
# File 'lib/delirium/platform/linux/keyboard.rb', line 5

def key_press(key:)
  case key
  when Symbol
    `xdotool type '#{key}'`
  end
end

#key_up(key:) ⇒ Object



19
20
21
22
23
24
# File 'lib/delirium/platform/linux/keyboard.rb', line 19

def key_up(key:)
  case key
  when Symbol
    `xdotool keyup '#{key}'`
  end
end

#write(string:) ⇒ Object



26
27
28
# File 'lib/delirium/platform/linux/keyboard.rb', line 26

def write(string:)
  `xdotool type '#{string}'`
end