X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gui.pas;h=494839e01324c73d6281594ff0db2a9c60d54d49;hb=d92a9e2807dda8a533def35afa801ed975920885;hp=8a599fd7a3a9a0c99c05245216c0f1882937dec6;hpb=84fa2f88d5d832ed9cc932fd2860d74467e242e1;p=d2df-sdl.git diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 8a599fd..494839e 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -535,6 +535,7 @@ type var g_GUIWindows: array of TGUIWindow; g_ActiveWindow: TGUIWindow = nil; + g_GUIGrabInput: Boolean = False; procedure g_GUI_Init(); function g_GUI_AddWindow(Window: TGUIWindow): TGUIWindow; @@ -837,7 +838,7 @@ begin if Msg.Msg = WM_KEYDOWN then begin case Msg.wParam of - IK_ESCAPE, VK_ESCAPE, JOY0_JUMP, JOY1_JUMP, JOY2_JUMP, JOY3_JUMP: + VK_ESCAPE: begin g_GUI_HideWindow; Exit @@ -2335,7 +2336,8 @@ begin end; end; - g_Touch_ShowKeyboard(FWindow.FActiveControl = Self); + g_GUIGrabInput := FWindow.FActiveControl = Self; + g_Touch_ShowKeyboard(g_GUIGrabInput) end; procedure TGUIEdit.SetText(Text: string); @@ -2416,7 +2418,7 @@ begin case Msg of WM_KEYDOWN: case wParam of - IK_ESCAPE, VK_ESCAPE, JOY0_JUMP, JOY1_JUMP, JOY2_JUMP, JOY3_JUMP: + VK_ESCAPE: begin if FIsQuery then actDefCtl(); FIsQuery := False; @@ -2431,9 +2433,10 @@ begin FIsQuery := True; end - else + else if (wParam < VK_FIRSTKEY) and (wParam > VK_LASTKEY) then begin - FKey := IK_ENTER; // + // FKey := IK_ENTER; // + FKey := wParam; FIsQuery := False; actDefCtl(); end; @@ -2458,7 +2461,7 @@ begin else if FIsQuery then begin case wParam of - IK_ENTER, IK_KPRETURN, VK_FIRE, VK_OPEN, JOY0_ATTACK, JOY1_ATTACK, JOY2_ATTACK, JOY3_ATTACK: // Not '' then FKey := wParam; @@ -2468,6 +2471,8 @@ begin end; end; end; + + g_GUIGrabInput := FIsQuery end; { TGUIKeyRead2 } @@ -2569,7 +2574,7 @@ begin case Msg of WM_KEYDOWN: case wParam of - IK_ESCAPE, VK_ESCAPE, JOY0_JUMP, JOY1_JUMP, JOY2_JUMP, JOY3_JUMP: + VK_ESCAPE: begin if FIsQuery then actDefCtl(); FIsQuery := False; @@ -2584,9 +2589,10 @@ begin FIsQuery := True; end - else + else if (wParam < VK_FIRSTKEY) and (wParam > VK_LASTKEY) then begin - if (FKeyIdx = 0) then FKey0 := IK_ENTER else FKey1 := IK_ENTER; // + // if (FKeyIdx = 0) then FKey0 := IK_ENTER else FKey1 := IK_ENTER; // + if (FKeyIdx = 0) then FKey0 := wParam else FKey1 := wParam; FIsQuery := False; actDefCtl(); end; @@ -2623,8 +2629,7 @@ begin else if FIsQuery then begin case wParam of - IK_ENTER, IK_KPRETURN, VK_FIRE, VK_OPEN, - JOY0_ATTACK, JOY1_ATTACK, JOY2_ATTACK, JOY3_ATTACK: // Not '' then begin @@ -2636,6 +2641,8 @@ begin end; end; end; + + g_GUIGrabInput := FIsQuery end; @@ -3144,7 +3151,7 @@ end; procedure TGUIFileListBox.OnMessage(var Msg: TMessage); var - a: Integer; + a, b: Integer; begin if not FEnabled then Exit; @@ -3241,7 +3248,9 @@ begin end; WM_CHAR: - for a := 0 to High(FItems) do + for b := FIndex + 1 to High(FItems) + FIndex do + begin + a := b mod Length(FItems); if ( (Length(FItems[a]) > 0) and (LowerCase(FItems[a][1]) = LowerCase(Chr(wParam))) ) or ( (Length(FItems[a]) > 1) and @@ -3254,6 +3263,7 @@ begin FOnChangeEvent(Self); Break; end; + end; end; end;