23 uses SDLh, uTypes; |
23 uses SDLh, uTypes; |
24 |
24 |
25 procedure initModule; |
25 procedure initModule; |
26 procedure freeModule; |
26 procedure freeModule; |
27 |
27 |
28 function KeyNameToCode(name: shortstring): LongInt; inline; |
28 function KeyNameToCode(name: shortstring): LongInt; |
29 function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt; |
29 function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt; |
30 |
30 |
31 function KeyBindToCode(bind: shortstring): LongInt; |
31 function KeyBindToCode(bind: shortstring): LongInt; |
32 function KeyBindToName(bind: shortstring): shortstring; |
32 function KeyBindToName(bind: shortstring): shortstring; |
33 //procedure MaskModifier(var code: LongInt; modifier: LongWord); |
33 //procedure MaskModifier(var code: LongInt; modifier: LongWord); |
34 procedure MaskModifier(Modifier: shortstring; var code: LongInt); |
34 procedure MaskModifier(Modifier: shortstring; var code: LongInt); |
35 procedure ProcessMouseButton(event: TSDL_MouseButtonEvent; ButtonDown: boolean); |
35 procedure ProcessMouseButton(event: TSDL_MouseButtonEvent; ButtonDown: boolean); |
36 procedure ProcessMouseMotion(xrel, yrel: LongInt); |
36 procedure ProcessMouseMotion(xrel, yrel: LongInt); |
37 //procedure ProcessMouseWheel(x, y: LongInt); |
37 //procedure ProcessMouseWheel(x, y: LongInt); |
38 procedure ProcessMouseWheel(y: LongInt); |
38 procedure ProcessMouseWheel(y: LongInt); |
39 procedure ProcessKey(event: TSDL_KeyboardEvent); inline; |
39 procedure ProcessKey(event: TSDL_KeyboardEvent); |
40 procedure ProcessKey(code: LongInt; KeyDown: boolean); |
40 procedure ProcessKey(code: LongInt; KeyDown: boolean); |
41 |
41 |
42 {$IFDEF USE_AM_NUMCOLUMN} |
42 {$IFDEF USE_AM_NUMCOLUMN} |
43 function CheckDefaultSlotKeys: boolean; |
43 function CheckDefaultSlotKeys: boolean; |
44 {$ENDIF} |
44 {$ENDIF} |
82 //ControllerAxes: array[0..5] of array[0..19] of Integer; |
82 //ControllerAxes: array[0..5] of array[0..19] of Integer; |
83 //ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer; |
83 //ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer; |
84 //ControllerHats: array[0..5] of array[0..19] of Byte; |
84 //ControllerHats: array[0..5] of array[0..19] of Byte; |
85 //ControllerButtons: array[0..5] of array[0..19] of Byte; |
85 //ControllerButtons: array[0..5] of array[0..19] of Byte; |
86 |
86 |
87 function KeyNameToCode(name: shortstring): LongInt; inline; |
87 function KeyNameToCode(name: shortstring): LongInt; |
88 begin |
88 begin |
89 KeyNameToCode:= KeyNameToCode(name, ''); |
89 KeyNameToCode:= KeyNameToCode(name, ''); |
90 end; |
90 end; |
91 |
91 |
92 function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt; |
92 function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt; |
292 LocalMessage:= LocalMessage and (not gmSwitch) |
292 LocalMessage:= LocalMessage and (not gmSwitch) |
293 end |
293 end |
294 end |
294 end |
295 end; |
295 end; |
296 |
296 |
297 procedure ProcessKey(event: TSDL_KeyboardEvent); inline; |
297 procedure ProcessKey(event: TSDL_KeyboardEvent); |
298 var code: LongInt; |
298 var code: LongInt; |
299 begin |
299 begin |
300 // TODO |
300 // TODO |
301 code:= LongInt(event.keysym.scancode); |
301 code:= LongInt(event.keysym.scancode); |
302 //writelntoconsole('[KEY] '+inttostr(code)+ ' -> ''' +KeyNames[code] + ''', type = '+inttostr(event.type_)); |
302 //writelntoconsole('[KEY] '+inttostr(code)+ ' -> ''' +KeyNames[code] + ''', type = '+inttostr(event.type_)); |