60 KbdKeyPressed:= false; |
60 KbdKeyPressed:= false; |
61 Trusted:= (CurrentTeam <> nil) |
61 Trusted:= (CurrentTeam <> nil) |
62 and (not CurrentTeam^.ExtDriven) |
62 and (not CurrentTeam^.ExtDriven) |
63 and (CurrentHedgehog^.BotLevel = 0); |
63 and (CurrentHedgehog^.BotLevel = 0); |
64 |
64 |
|
65 {$IFDEF SDL13} |
|
66 pkbd:= SDL_GetKeyboardState(nil); |
|
67 {$ELSE} |
65 pkbd:= SDL_GetKeyState(nil); |
68 pkbd:= SDL_GetKeyState(nil); |
|
69 {$ENDIF} |
66 i:= SDL_GetMouseState(nil, nil); |
70 i:= SDL_GetMouseState(nil, nil); |
67 pkbd^[1]:= (i and 1); |
71 pkbd^[1]:= (i and 1); |
68 pkbd^[2]:= ((i shr 1) and 1); |
72 pkbd^[2]:= ((i shr 1) and 1); |
|
73 {$IFDEF DARWIN} |
|
74 // normal right click || ctrl (left/right) + left click |
|
75 pkbd^[3]:= ((i shr 2) and 1) or ((i and 1) and (pkbd^[306] or pkbd^[305])); |
|
76 {$ELSE} |
69 pkbd^[3]:= ((i shr 2) and 1); |
77 pkbd^[3]:= ((i shr 2) and 1); |
|
78 {$ENDIF} |
|
79 |
70 for i:= 1 to cKeyMaxIndex do |
80 for i:= 1 to cKeyMaxIndex do |
71 if CurrentBinds[i][0] <> #0 then |
81 if CurrentBinds[i][0] <> #0 then |
72 begin |
82 begin |
73 if (i > 3) and (pkbd^[i] <> 0) then KbdKeyPressed:= true; |
83 if (i > 3) and (pkbd^[i] <> 0) then KbdKeyPressed:= true; |
74 if (tkbd[i] = 0) and (pkbd^[i] <> 0) then ParseCommand(CurrentBinds[i], Trusted) |
84 if (tkbd[i] = 0) and (pkbd^[i] <> 0) then ParseCommand(CurrentBinds[i], Trusted) |