hedgewars/uInputHandler.pas
changeset 7089 6c7210257945
parent 7088 dbec9bae4de1
child 7106 aacb90365d3d
equal deleted inserted replaced
7088:dbec9bae4de1 7089:6c7210257945
    24 
    24 
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 
    27 
    28 function  KeyNameToCode(name: shortstring): word;
    28 function  KeyNameToCode(name: shortstring): word;
    29 procedure ProcessKbd;
       
    30 procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
    29 procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
    31 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
    30 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
    32 procedure ProcessKey(code: LongInt; KeyDown: boolean);
    31 procedure ProcessKey(code: LongInt; KeyDown: boolean);
    33 
    32 
    34 procedure ResetKbd;
    33 procedure ResetKbd;
    56 begin
    55 begin
    57     name:= LowerCase(name);
    56     name:= LowerCase(name);
    58     code:= cKeyMaxIndex;
    57     code:= cKeyMaxIndex;
    59     while (code > 0) and (KeyNames[code] <> name) do dec(code);
    58     while (code > 0) and (KeyNames[code] <> name) do dec(code);
    60     KeyNameToCode:= code;
    59     KeyNameToCode:= code;
    61 end;
       
    62 
       
    63 procedure ProcessKbd;
       
    64 //var  i, j, k: LongInt;
       
    65 begin
       
    66 
       
    67 // move cursor/camera
       
    68 // TODO: Scale on screen dimensions and/or axis value (game controller)?
       
    69 //TODO what is this for?
       
    70 movecursor(5 * CursorMovementX, 5 * CursorMovementY);
       
    71 end;
    60 end;
    72 
    61 
    73 procedure ProcessKey(code: LongInt; KeyDown: boolean);
    62 procedure ProcessKey(code: LongInt; KeyDown: boolean);
    74 var
    63 var
    75     Trusted: boolean;
    64     Trusted: boolean;