hedgewars/hwengine.pas
branchwebgl
changeset 8833 c13ebed437cb
parent 8444 75db7bb8dce8
parent 8742 b7b8bd398c1b
child 8847 ff7fbab7cd56
equal deleted inserted replaced
8450:404ddce27b23 8833:c13ebed437cb
   194         begin
   194         begin
   195             case event.type_ of
   195             case event.type_ of
   196 {$IFDEF SDL13}
   196 {$IFDEF SDL13}
   197                 SDL_KEYDOWN:
   197                 SDL_KEYDOWN:
   198                     if GameState = gsChat then
   198                     if GameState = gsChat then
       
   199                         begin
   199                     // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3
   200                     // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3
   200                         KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym))//TODO correct for keymodifiers
   201                         KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym, event.key.keysym.sym)//TODO correct for keymodifiers
       
   202                         end
   201                     else
   203                     else
   202                         ProcessKey(event.key);
   204                         ProcessKey(event.key);
   203                 SDL_KEYUP:
   205                 SDL_KEYUP:
   204                     if GameState <> gsChat then
   206                     if GameState <> gsChat then
   205                         ProcessKey(event.key);
   207                         ProcessKey(event.key);
   239                 SDL_FINGERUP:
   241                 SDL_FINGERUP:
   240                     onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
   242                     onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
   241 {$ELSE}
   243 {$ELSE}
   242                 SDL_KEYDOWN:
   244                 SDL_KEYDOWN:
   243                     if GameState = gsChat then
   245                     if GameState = gsChat then
   244                         KeyPressChat(event.key.keysym.unicode)
   246                         KeyPressChat(event.key.keysym.unicode, event.key.keysym.sym)
   245                     else
   247                     else
   246                         ProcessKey(event.key);
   248                         ProcessKey(event.key);
   247                 SDL_KEYUP:
   249                 SDL_KEYUP:
   248                     if GameState <> gsChat then
   250                     if GameState <> gsChat then
   249                         ProcessKey(event.key);
   251                         ProcessKey(event.key);
   382 {$IFDEF HWLIBRARY}
   384 {$IFDEF HWLIBRARY}
   383     preInitEverything();
   385     preInitEverything();
   384     parseCommandLine(argc, argv);
   386     parseCommandLine(argc, argv);
   385 {$ENDIF}
   387 {$ENDIF}
   386     initEverything(true);
   388     initEverything(true);
   387     WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')');
   389     WriteLnToConsole('Hedgewars engine ' + cVersionString + '-r' + cRevisionString +
   388 
   390                      ' (' + cHashString + ') with protocol #' + inttostr(cNetProtoVersion));
       
   391     AddFileLog('Prefix: "' + PathPrefix +'"');
       
   392     AddFileLog('UserPrefix: "' + UserPathPrefix +'"');
       
   393     
   389     for i:= 0 to ParamCount do
   394     for i:= 0 to ParamCount do
   390         AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   395         AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   391 
   396 
   392     WriteToConsole('Init SDL... ');
   397     WriteToConsole('Init SDL... ');
   393     if not cOnlyStats then SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
   398     if not cOnlyStats then SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);