Add <bs>, <wait5>, <wait10>, <del> special keys (Packerisms) #989

Merged
merged 2 commits into from Oct 23, 2014
@@ -38,12 +38,15 @@ class Scancode
@@special_keys=Hash.new;
@@special_keys['<Enter>'] = '1c 9c';
@@special_keys['<Backspace>'] = '0e 8e';
+ @@special_keys['<Bs>'] = '0e 8e';
@@special_keys['<Spacebar>'] = '39 b9';
@@special_keys['<Return>'] = '1c 9c'
@@special_keys['<Esc>'] = '01 81';
@@special_keys['<Tab>'] = '0f 8f';
@@special_keys['<KillX>'] = '1d 38 0e b8';
@@special_keys['<Wait>'] = 'wait';
+ @@special_keys['<Wait5>'] = 'wait5';
+ @@special_keys['<Wait10>'] = 'wait10';
@@special_keys['<Up>'] = '48 c8';
@@special_keys['<Down>'] = '50 d0';
@@ -52,6 +55,7 @@ class Scancode
@@special_keys['<End>'] = '4f cf';
@@special_keys['<Insert>'] = '52 d2';
@@special_keys['<Delete>'] = '53 d3';
+ @@special_keys['<Del>'] = '53 d3';
@@special_keys['<Left>'] = '4b cb';
@@special_keys['<Right>'] = '4d cd';
@@special_keys['<Home>'] = '47 c7';
@@ -29,11 +29,13 @@ def send_virtualbox_sequence(sequence)
# A workaround is to send the scancodes one-by-one.
codes=""
for keycode in keycodes.split(' ') do
- unless keycode=="wait"
- send_keycode(keycode)
- sleep 0.01
- else
- sleep 1
+ case keycode
+ when 'wait' then sleep 1
+ when 'wait5' then sleep 5
+ when 'wait10' then sleep 10
+ else
+ send_keycode(keycode)
+ sleep 0.01
end
end
#sleep after each sequence (needs to be param)