consular icon indicating copy to clipboard operation
consular copied to clipboard

Sending keystrokes or keyboard shortcuts

Open jlecour opened this issue 15 years ago • 1 comments

It could be useful to send some keystrokes to the system (not just the Terminal window). This way one could ask SizeUp to resize/move the windows, …

jlecour avatar Sep 28 '10 06:09 jlecour

Exactly. I tried doing this myself but am getting errors using appscript.

require 'appscript' t = Appscript.app('System Events')

window do

key_code 123 is left arrow -- this is a sizeup command I setup

t.key_code( 123, :using => [:option_down, :control_down, :shift_down] ) end

$ terminitor start => /Users/defn/.rvm/gems/ruby-1.8.7-p302@global/gems/terminitor-0.1.0/lib/terminitor/dsl.rb:10:in initialize': undefined method<<' for {}:Hash (NoMethodError) from (eval):10:in initialize' from /Users/defn/.rvm/gems/ruby-1.8.7-p302@global/gems/terminitor-0.1.0/lib/terminitor/dsl.rb:33:ininstance_eval' from /Users/defn/.rvm/gems/ruby-1.8.7-p302@global/gems/terminitor-0.1.0/lib/terminitor/dsl.rb:33:in `window'

devn avatar Oct 08 '10 03:10 devn