summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4539fac)
raw | patch | inline | side by side (parent: 4539fac)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 6 Apr 2016 21:06:33 +0000 (00:06 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 6 Apr 2016 21:06:49 +0000 (00:06 +0300) |
diff --git a/src/engine/e_input.pas b/src/engine/e_input.pas
index 618199d2bb1837bf1b404c20a401fb64dc40ff2c..b16508fb3a4171a85f99630c9b18776be47a27e3 100644 (file)
--- a/src/engine/e_input.pas
+++ b/src/engine/e_input.pas
IK_INVALID = 65535;
IK_ESCAPE = SDL_SCANCODE_ESCAPE;
IK_RETURN = SDL_SCANCODE_RETURN;
+ IK_KPRETURN= SDL_SCANCODE_KP_ENTER;
IK_ENTER = SDL_SCANCODE_RETURN;
IK_UP = SDL_SCANCODE_UP;
+ IK_KPUP = SDL_SCANCODE_KP_8;
IK_DOWN = SDL_SCANCODE_DOWN;
+ IK_KPDOWN = SDL_SCANCODE_KP_2;
IK_LEFT = SDL_SCANCODE_LEFT;
+ IK_KPLEFT = SDL_SCANCODE_KP_4;
IK_RIGHT = SDL_SCANCODE_RIGHT;
+ IK_KPRIGHT = SDL_SCANCODE_KP_6;
IK_DELETE = SDL_SCANCODE_DELETE;
IK_HOME = SDL_SCANCODE_HOME;
+ IK_KPHOME = SDL_SCANCODE_KP_7;
IK_INSERT = SDL_SCANCODE_INSERT;
IK_SPACE = SDL_SCANCODE_SPACE;
IK_CONTROL = SDL_SCANCODE_LCTRL;
IK_SHIFT = SDL_SCANCODE_LSHIFT;
IK_TAB = SDL_SCANCODE_TAB;
IK_PAGEUP = SDL_SCANCODE_PAGEUP;
+ IK_KPPAGEUP= SDL_SCANCODE_KP_9;
IK_PAGEDN = SDL_SCANCODE_PAGEDOWN;
+ IK_KPPAGEDN= SDL_SCANCODE_KP_3;
IK_F2 = SDL_SCANCODE_F2;
IK_F3 = SDL_SCANCODE_F3;
IK_F4 = SDL_SCANCODE_F4;
IK_F9 = SDL_SCANCODE_F9;
IK_F10 = SDL_SCANCODE_F10;
IK_END = SDL_SCANCODE_END;
+ IK_KPEND = SDL_SCANCODE_KP_1;
IK_BACKSPACE = SDL_SCANCODE_BACKSPACE;
IK_BACKQUOTE = SDL_SCANCODE_GRAVE;
IK_GRAVE = SDL_SCANCODE_GRAVE;
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index fc78ef05502bd56ac0e99bd60fe7ffde303befc0..4898bfb113ed2dacad7e59213b5cfaf464dcf02e 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
IK_DELETE:
if (Length(Line) > 0) and (CPos <= Length(Line)) then
Delete(Line, CPos, 1);
- IK_LEFT:
+ IK_LEFT, IK_KPLEFT:
if CPos > 1 then
CPos := CPos - 1;
- IK_RIGHT:
+ IK_RIGHT, IK_KPRIGHT:
if CPos <= Length(Line) then
CPos := CPos + 1;
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
begin
if Cons_Shown then
g_Console_Process(Line)
IK_TAB:
if not gChatShow then
Complete();
- IK_DOWN:
+ IK_DOWN, IK_KPDOWN:
if not gChatShow then
if (CommandHistory <> nil) and
(CmdIndex < Length(CommandHistory)) then
Line := CommandHistory[CmdIndex];
CPos := Length(Line) + 1;
end;
- IK_UP:
+ IK_UP, IK_KPUP:
if not gChatShow then
if (CommandHistory <> nil) and
(CmdIndex <= Length(CommandHistory)) then
Line := CommandHistory[CmdIndex];
Cpos := Length(Line) + 1;
end;
- IK_PAGEUP: // PgUp
+ IK_PAGEUP, IK_KPPAGEUP: // PgUp
if not gChatShow then
IncMax(OffSet, Length(ConsoleHistory)-1);
- IK_PAGEDN: // PgDown
+ IK_PAGEDN, IK_KPPAGEDN: // PgDown
if not gChatShow then
DecMin(OffSet, 0);
- IK_HOME:
+ IK_HOME, IK_KPHOME:
CPos := 1;
- IK_END:
+ IK_END, IK_KPEND:
CPos := Length(Line) + 1;
end;
end;
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 70dba84c6abbe6fe6663cf7058cb9ef4e8b0937d..265533e11fa49a7f094e3438865f55deb36975ee 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
if (not g_Game_IsClient) and
(
(
- (e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_SPACE))
+ (e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) or e_KeyPressed(IK_SPACE))
and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
and (g_ActiveWindow = nil)
)
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index ba095b7a79f616613e233d541124cb00c817afd6..7eaed7ba7128470653e26c6b53d49020b58f09b1 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN: Click();
+ IK_RETURN, IK_KPRETURN: Click();
end;
end;
end;
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_UP:
+ IK_UP, IK_KPUP:
begin
repeat
Dec(FIndex);
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_DOWN:
+ IK_DOWN, IK_KPDOWN:
begin
repeat
Inc(FIndex);
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_RETURN: if (FIndex <> -1) and FButtons[FIndex].FEnabled then FButtons[FIndex].Click;
+ IK_RETURN, IK_KPRETURN: if (FIndex <> -1) and FButtons[FIndex].FEnabled then FButtons[FIndex].Click;
end;
end;
end;
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN: if @FOnClickEvent <> nil then FOnClickEvent();
+ IK_RETURN, IK_KPRETURN: if @FOnClickEvent <> nil then FOnClickEvent();
end;
end;
end;
WM_KEYDOWN:
begin
case Msg.wParam of
- IK_UP:
+ IK_UP, IK_KPUP:
begin
c := 0;
repeat
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_DOWN:
+ IK_DOWN, IK_KPDOWN:
begin
c := 0;
repeat
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_LEFT, IK_RIGHT:
+ IK_LEFT, IK_RIGHT, IK_KPLEFT, IK_KPRIGHT:
begin
if FIndex <> -1 then
if FItems[FIndex].Control <> nil then
FItems[FIndex].Control.OnMessage(Msg);
end;
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
begin
if FIndex <> -1 then
if FItems[FIndex].Control <> nil then
WM_KEYDOWN:
begin
case Msg.wParam of
- IK_LEFT:
+ IK_LEFT, IK_KPLEFT:
if FValue > 0 then
begin
Dec(FValue);
g_Sound_PlayEx(SCROLL_SUBSOUND);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_RIGHT:
+ IK_RIGHT, IK_KPRIGHT:
if FValue < FMax then
begin
Inc(FValue);
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN, IK_RIGHT:
+ IK_RETURN, IK_RIGHT, IK_KPRETURN, IK_KPRIGHT:
begin
if FIndex < High(FItems) then
Inc(FIndex)
FOnChangeEvent(Self);
end;
- IK_LEFT:
+ IK_LEFT, IK_KPLEFT:
begin
if FIndex > 0 then
Dec(FIndex)
if FCaretPos > 0 then Dec(FCaretPos);
end;
IK_DELETE: Delete(FText, FCaretPos + 1, 1);
- IK_END: FCaretPos := Length(FText);
- IK_HOME: FCaretPos := 0;
- IK_LEFT: if FCaretPos > 0 then Dec(FCaretPos);
- IK_RIGHT: if FCaretPos < Length(FText) then Inc(FCaretPos);
- IK_RETURN:
+ IK_END, IK_KPEND: FCaretPos := Length(FText);
+ IK_HOME, IK_KPHOME: FCaretPos := 0;
+ IK_LEFT, IK_KPLEFT: if FCaretPos > 0 then Dec(FCaretPos);
+ IK_RIGHT, IK_KPRIGHT: if FCaretPos < Length(FText) then Inc(FCaretPos);
+ IK_RETURN, IK_KPRETURN:
with FWindow do
begin
if FActiveControl <> Self then
FIsQuery := False;
end;
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
begin
if not FIsQuery then
begin
end;
MESSAGE_DIKEY:
- if FIsQuery and (wParam <> IK_ENTER) then // Not <Enter
+ if FIsQuery and (wParam <> IK_ENTER) and (wParam <> IK_KPRETURN) then // Not <Enter
begin
if e_KeyNames[wParam] <> '' then
FKey := wParam;
case Msg of
WM_KEYDOWN:
case wParam of
- IK_HOME:
+ IK_HOME, IK_KPHOME:
begin
FIndex := 0;
FStartLine := 0;
end;
- IK_END:
+ IK_END, IK_KPEND:
begin
FIndex := High(FItems);
FStartLine := Max(High(FItems)-FHeight+1, 0);
end;
- IK_UP, IK_LEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
if FIndex > 0 then
begin
Dec(FIndex);
if FIndex < FStartLine then Dec(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_DOWN, IK_RIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
if FIndex < High(FItems) then
begin
Inc(FIndex);
if FIndex > FStartLine+FHeight-1 then Inc(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
with FWindow do
begin
if FActiveControl <> Self then SetActive(Self)
case Msg of
WM_KEYDOWN:
case wParam of
- IK_HOME:
+ IK_HOME, IK_KPHOME:
begin
FIndex := 0;
FStartLine := 0;
FOnChangeEvent(Self);
end;
- IK_END:
+ IK_END, IK_KPEND:
begin
FIndex := High(FItems);
FStartLine := Max(High(FItems)-FHeight+1, 0);
FOnChangeEvent(Self);
end;
- IK_PAGEUP:
+ IK_PAGEUP, IK_KPPAGEUP:
begin
if FIndex > FHeight then
FIndex := FIndex-FHeight
FStartLine := 0;
end;
- IK_PAGEDN:
+ IK_PAGEDN, IK_KPPAGEDN:
begin
if FIndex < High(FItems)-FHeight then
FIndex := FIndex+FHeight
FStartLine := High(FItems)-FHeight+1;
end;
- IK_UP, IK_LEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
if FIndex > 0 then
begin
Dec(FIndex);
FOnChangeEvent(Self);
end;
- IK_DOWN, IK_RIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
if FIndex < High(FItems) then
begin
Inc(FIndex);
FOnChangeEvent(Self);
end;
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
with FWindow do
begin
if FActiveControl <> Self then
case Msg of
WM_KEYDOWN:
case wParam of
- IK_UP, IK_LEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
if FStartLine > 0 then
Dec(FStartLine);
- IK_DOWN, IK_RIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
if FStartLine < Length(FLines)-FHeight then
Inc(FStartLine);
- IK_RETURN:
+ IK_RETURN, IK_KPRETURN:
with FWindow do
begin
if FActiveControl <> Self then
index 194a1eda69d89aaaa2212206c09b3f4cc2293086..a1b9b6feda29f39b78307cbedc888586d0b81529 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
if SL = nil then Exit;
- if e_KeyPressed(IK_RETURN) then
+ if e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) then
begin
if not slReturnPressed then
begin
else
slReturnPressed := False;
- if e_KeyPressed(IK_DOWN) then
+ if e_KeyPressed(IK_DOWN) or e_KeyPressed(IK_KPDOWN) then
begin
if not slDirPressed then
begin
end;
end;
- if e_KeyPressed(IK_UP) then
+ if e_KeyPressed(IK_UP) or e_KeyPressed(IK_KPUP) then
begin
if not slDirPressed then
begin
end;
end;
- if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) then
+ if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) and (not e_KeyPressed(IK_KPDOWN)) and (not e_KeyPressed(IK_KPUP)) then
slDirPressed := False;
end;