equal
deleted
inserted
replaced
172 begin |
172 begin |
173 PrevTime:= SDL_GetTicks; |
173 PrevTime:= SDL_GetTicks; |
174 repeat |
174 repeat |
175 while SDL_PollEvent(@event) <> 0 do |
175 while SDL_PollEvent(@event) <> 0 do |
176 case event.type_ of |
176 case event.type_ of |
177 {$IFDEF IPHONEOS} |
177 {$IFDEF SDL13} |
178 SDL_WINDOWEVENT: |
178 SDL_WINDOWEVENT: |
179 {$ELSE} |
179 {$ELSE} |
180 SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode); |
180 SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode); |
181 SDL_ACTIVEEVENT: |
181 SDL_ACTIVEEVENT: |
182 {$ENDIF} |
182 {$ENDIF} |
183 if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
183 if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then |
184 cHasFocus:= event.active.gain = 1; |
184 cHasFocus:= event.active.gain = 1; |
185 //SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450)); |
185 //SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450)); |
186 {$IFDEF IPHONEOS} |
186 {$IFDEF TOUCHINPUT} |
187 {*MoveCamera is in uWord.pas -- conflicts with other commands*} |
187 {*MoveCamera is in uWord.pas -- conflicts with other commands*} |
188 {*Keys are in uKeys.pas*} |
188 {*Keys are in uKeys.pas*} |
189 SDL_MOUSEBUTTONDOWN: begin |
189 SDL_MOUSEBUTTONDOWN: begin |
190 AddFileLog('********************************************* touch down'); |
190 AddFileLog('********************************************* touch down'); |
191 |
191 |
271 end; |
271 end; |
272 end; |
272 end; |
273 SDL_MOUSEBUTTONUP: begin |
273 SDL_MOUSEBUTTONUP: begin |
274 AddFileLog('********************************************* touch up'); |
274 AddFileLog('********************************************* touch up'); |
275 |
275 |
276 // if bShowAmmoMenu = true then |
|
277 |
|
278 SDL_GetMouseState(0, @x, @y); |
276 SDL_GetMouseState(0, @x, @y); |
279 {* open ammo menu *} |
277 {* open ammo menu *} |
280 if (y > 430) and (x > 270) then |
278 if (y > 430) and (x > 270) then |
281 begin |
279 begin |
282 {$IFDEF DEBUGFILE} |
280 {$IFDEF DEBUGFILE} |
283 AddFileLog('Right Click -- x: ' + inttostr(x) + ' y: ' + inttostr(y) ); |
281 AddFileLog('Right Click -- x: ' + inttostr(x) + ' y: ' + inttostr(y) ); |
284 {$ENDIF} |
282 {$ENDIF} |
285 uKeys.rightClick:= true; |
283 uKeys.rightClick:= true; |
286 end; |
284 end; |
287 end; |
285 end; |
|
286 {$ENDIF} |
|
287 {$IFDEF IPHONEOS} |
288 SDL_JOYAXIS: begin |
288 SDL_JOYAXIS: begin |
289 {* axis 0 = left and right; |
289 {* axis 0 = left and right; |
290 axis 1 = up and down; |
290 axis 1 = up and down; |
291 axis 2 = back and forth; *} |
291 axis 2 = back and forth; *} |
292 if (event.jaxis.axis = 0) and (CurrentTeam <> nil) then |
292 if (event.jaxis.axis = 0) and (CurrentTeam <> nil) then |