summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8d321d)
raw | patch | inline | side by side (parent: d8d321d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 6 Oct 2019 22:03:09 +0000 (01:03 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 13 Oct 2019 14:19:20 +0000 (17:19 +0300) |
src/game/sdl/g_system.pas | patch | blob | history | |
src/shared/utils.pas | patch | blob | history |
index 81b1ca3dc6ade228ac39c49b5d7cbc1e41409252..25e95eca8841d5a987f5e87bb218bc0cb4f26fb9 100644 (file)
begin
KeyPress(key)
end;
- if down and (ev.keysym.unicode <= $44F) then
- begin
- if IsPrintable1251(ch) then
- CharPress(ch)
- end
+ if down and IsValid1251(ev.keysym.unicode) and IsPrintable1251(ch) then
+ CharPress(ch)
end;
function sys_HandleInput (): Boolean;
diff --git a/src/shared/utils.pas b/src/shared/utils.pas
index 4c4db7b0df59997698bca6e3d5861cb9ba9a01a0..20706c661dae397f8a0b4914ab00e9caa765a252 100644 (file)
--- a/src/shared/utils.pas
+++ b/src/shared/utils.pas
function upcase1251 (ch: AnsiChar): AnsiChar; inline;
function locase1251 (ch: AnsiChar): AnsiChar; inline;
+function IsValid1251 (ch: Word): Boolean;
function IsPrintable1251 (ch: AnsiChar): Boolean;
function toLowerCase1251 (const s: AnsiString): AnsiString;
result := ch;
end;
+function IsValid1251 (ch: Word): Boolean;
+begin
+ result := (ch = Ord('?')) or (wc2shitmap[ch] <> '?')
+end;
+
function IsPrintable1251 (ch: AnsiChar): Boolean;
begin
result := (ch >= #32) and (ch <> #127)