Skip to content

Commit

Permalink
Adds TReflectionKeyboard.SendArrowWait
Browse files Browse the repository at this point in the history
Allows to send a arrow key and wait to release it.
-Preparing for TReflectionAntiban
  • Loading branch information
elfyyy committed Jan 8, 2016
1 parent 8e9ff8b commit c71c8e8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/core/input/Keyboard.simba
Expand Up @@ -20,3 +20,23 @@ begin
if Send then
Reflect.Keyboard.TypeKey(Vk_Enter);
end;

procedure TReflectionKeyboard.SendArrowWait(Key: Byte; WaitTime: Integer);
var
KeyCode : integer;
begin;
if not InRange(Key,0,3) then
Reflect.Logger.Warn('Key is not in range')
else
begin
case Key of
0 : Keycode := (vk_up);
1 : Keycode := (vk_right);
2 : Keycode := (vk_down);
3 : Keycode := (vk_left);
end;
KeyDown(KeyCode);
Wait(WaitTime);
KeyUp(KeyCode);
end;
end;

0 comments on commit c71c8e8

Please sign in to comment.