X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_touch.pas;h=b9250acb63bd32958b50e96cb4617e1b0d6360f3;hb=a7b5840560ba63bca3b9fc7f7608fffa8c0b0e41;hp=972c5422283f1c53f42d7ceb50097d7488661f14;hpb=4de34c0c003869d8f125768be330702020f3c514;p=d2df-sdl.git diff --git a/src/game/g_touch.pas b/src/game/g_touch.pas index 972c542..b9250ac 100644 --- a/src/game/g_touch.pas +++ b/src/game/g_touch.pas @@ -37,7 +37,7 @@ implementation uses SysUtils, - e_log, e_graphics, e_input, g_options, g_game, g_main, g_gui, g_weapons, g_console; + e_log, e_graphics, e_input, g_options, g_game, g_main, g_gui, g_weapons, g_console, g_window; var angleFire: Boolean; @@ -184,6 +184,7 @@ implementation procedure g_Touch_Init; begin {$IFNDEF HEADLESS} + g_Touch_ShowKeyboard(FALSE); g_touch_enabled := SDL_GetNumTouchDevices() > 0 {$ENDIF} end; @@ -191,10 +192,10 @@ implementation procedure g_Touch_ShowKeyboard(yes: Boolean); begin {$IFNDEF HEADLESS} - if not g_touch_enabled then - Exit; - - if yes then + if g_dbg_input then + e_LogWritefln('g_Touch_ShowKeyboard(%s)', [yes]); + (* on desktop we always receive text (needed for cheats) *) + if yes or (SDL_HasScreenKeyboardSupport() = SDL_FALSE) then SDL_StartTextInput else SDL_StopTextInput @@ -207,6 +208,9 @@ implementation procedure KeyUp (finger, i: Integer); begin + if g_dbg_input then + e_LogWritefln('Input Debug: g_touch.KeyUp, finger=%s, key=%s', [finger, i]); + keyFinger[i] := 0; e_KeyUpDown(i, False); g_Console_ProcessBind(i, False); @@ -226,6 +230,9 @@ implementation procedure KeyDown (finger, i: Integer); begin + if g_dbg_input then + e_LogWritefln('Input Debug: g_touch.KeyDown, finger=%s, key=%s', [finger, i]); + keyFinger[i] := finger; e_KeyUpDown(i, True); g_Console_ProcessBind(i, True);