equal
deleted
inserted
replaced
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} |
65 {$IFDEF SDL13} |
66 pkbd:= SDL_GetKeyboardState(nil); |
66 pkbd := SDL_GetKeyboardState(nil); |
|
67 i := SDL_GetMouseState(0, nil, nil); |
67 {$ELSE} |
68 {$ELSE} |
68 pkbd:= SDL_GetKeyState(nil); |
69 pkbd := SDL_GetKeyState(nil); |
|
70 i := SDL_GetMouseState(nil, nil); |
69 {$ENDIF} |
71 {$ENDIF} |
70 {$IFDEF IPHONEOS} |
72 |
71 //SDL_GetMouseState currently broken in sdl13 |
|
72 i:=1; |
|
73 {$ELSE} |
|
74 i:=SDL_GetMouseState(nil, nil); |
|
75 {$ENDIF} |
|
76 pkbd^[1]:= (i and 1); |
73 pkbd^[1]:= (i and 1); |
77 pkbd^[2]:= ((i shr 1) and 1); |
74 pkbd^[2]:= ((i shr 1) and 1); |
|
75 |
78 {$IFDEF DARWIN} |
76 {$IFDEF DARWIN} |
79 // normal right click || ctrl (left/right) + left click |
77 // normal right click || ctrl (left/right) + left click |
80 pkbd^[3]:= ((i shr 2) and 1) or ((i and 1) and (pkbd^[306] or pkbd^[305])); |
78 pkbd^[3]:= ((i shr 2) and 1) or ((i and 1) and (pkbd^[306] or pkbd^[305])); |
81 {$ELSE} |
79 {$ELSE} |
82 pkbd^[3]:= ((i shr 2) and 1); |
80 pkbd^[3]:= ((i shr 2) and 1); |
101 |
99 |
102 procedure ResetKbd; |
100 procedure ResetKbd; |
103 var i, t: LongInt; |
101 var i, t: LongInt; |
104 pkbd: PByteArray; |
102 pkbd: PByteArray; |
105 begin |
103 begin |
|
104 |
106 {$IFDEF SDL13} |
105 {$IFDEF SDL13} |
107 pkbd:= PByteArray(SDL_GetKeyboardState(@i)); |
106 pkbd:= PByteArray(SDL_GetKeyboardState(@i)); |
108 {$ELSE} |
107 {$ELSE} |
109 pkbd:= PByteArray(SDL_GetKeyState(@i)); |
108 pkbd:= PByteArray(SDL_GetKeyState(@i)); |
110 {$ENDIF} |
109 {$ENDIF} |
111 TryDo(i < cKeyMaxIndex, 'SDL keys number is more than expected (' + inttostr(i) + ')', true); |
110 TryDo(i < cKeyMaxIndex, 'SDL keys number is more than expected (' + inttostr(i) + ')', true); |
|
111 |
112 for t:= 0 to Pred(i) do |
112 for t:= 0 to Pred(i) do |
113 tkbd[i]:= pkbd^[i] |
113 tkbd[i]:= pkbd^[i] |
|
114 |
114 end; |
115 end; |
115 |
116 |
116 procedure InitKbdKeyTable; |
117 procedure InitKbdKeyTable; |
117 var i, t: LongInt; |
118 var i, t: LongInt; |
118 s: string[15]; |
119 s: string[15]; |