Module: Rum::WindowInfo
- Defined in:
- lib/rum/help.rb
Constant Summary collapse
- StopKey =
'escape'
Class Method Summary collapse
Class Method Details
.register_stop_key ⇒ Object
114 115 116 117 118 |
# File 'lib/rum/help.rb', line 114 def register_stop_key @old_action = StopKey.unregister StopKey.do { WindowInfo.stop } Gui. "Press '#{StopKey}' to stop WindowInfo." end |
.start ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/rum/help.rb', line 90 def start return if @thread register_stop_key @stop = false @thread = Thread.new do new = old = nil loop do break if @stop new = active_window if new != old window_report = new.report Gui.(window_report) { System::Clipboard.set window_report } old = new end sleep 0.1 end Clipboard.set new.report Gui. 'Window Info stopped.' @thread = nil end end |