fixes in input

This commit is contained in:
p.kosyh 2011-07-31 11:14:33 +00:00
parent d47b394c9b
commit edc9824118
2 changed files with 12 additions and 3 deletions

1
debian/changelog vendored
View file

@ -11,6 +11,7 @@ instead (1.4.5) unstable; urgency=low
* theme_name added;
* now fading first value is new scene flag;
* more information in error messages while checking lists;
* fixes in input module;
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jul 2011 16:18:00 +0400

View file

@ -170,7 +170,7 @@ local function kbdxlat(s)
return
end
if input.kbd_alt and
if input.kbd_alt_xlat and
(game.codepage == 'UTF-8' or game.codepage == 'utf-8') then
kbd = kbdru;
else
@ -219,8 +219,11 @@ local input_kbd = function(s, down, key)
end
if key:find("shift") then
input.kbd_shift = down
elseif key:find("alt") and down then
input.kbd_alt = not input.kbd_alt;
elseif key:find("alt") then
if down and input.inp_xlat then
input.kbd_alt_xlat = not input.kbd_alt_xlat;
end
input.kbd_alt = down
elseif down then
if input.kbd_alt then
return
@ -248,6 +251,10 @@ local input_kbd = function(s, down, key)
end
local c = kbdxlat(key);
if not c then return end
if type(input.inp_filter) == 'function' then
c = input:inp_filter(c);
if not c then return end
end
input._txt = input._txt..c;
return "wait"
end
@ -255,6 +262,7 @@ end
stead.module_init(function()
input.cursor = '_'
input.inp_xlat = true
input.key = stead.hook(input.key,
function(f, ...)
local r = input_kbd(...)