fixes in input
This commit is contained in:
parent
d47b394c9b
commit
edc9824118
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -11,6 +11,7 @@ instead (1.4.5) unstable; urgency=low
|
||||||
* theme_name added;
|
* theme_name added;
|
||||||
* now fading first value is new scene flag;
|
* now fading first value is new scene flag;
|
||||||
* more information in error messages while checking lists;
|
* 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
|
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jul 2011 16:18:00 +0400
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ local function kbdxlat(s)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if input.kbd_alt and
|
if input.kbd_alt_xlat and
|
||||||
(game.codepage == 'UTF-8' or game.codepage == 'utf-8') then
|
(game.codepage == 'UTF-8' or game.codepage == 'utf-8') then
|
||||||
kbd = kbdru;
|
kbd = kbdru;
|
||||||
else
|
else
|
||||||
|
@ -219,8 +219,11 @@ local input_kbd = function(s, down, key)
|
||||||
end
|
end
|
||||||
if key:find("shift") then
|
if key:find("shift") then
|
||||||
input.kbd_shift = down
|
input.kbd_shift = down
|
||||||
elseif key:find("alt") and down then
|
elseif key:find("alt") then
|
||||||
input.kbd_alt = not input.kbd_alt;
|
if down and input.inp_xlat then
|
||||||
|
input.kbd_alt_xlat = not input.kbd_alt_xlat;
|
||||||
|
end
|
||||||
|
input.kbd_alt = down
|
||||||
elseif down then
|
elseif down then
|
||||||
if input.kbd_alt then
|
if input.kbd_alt then
|
||||||
return
|
return
|
||||||
|
@ -248,6 +251,10 @@ local input_kbd = function(s, down, key)
|
||||||
end
|
end
|
||||||
local c = kbdxlat(key);
|
local c = kbdxlat(key);
|
||||||
if not c then return end
|
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;
|
input._txt = input._txt..c;
|
||||||
return "wait"
|
return "wait"
|
||||||
end
|
end
|
||||||
|
@ -255,6 +262,7 @@ end
|
||||||
|
|
||||||
stead.module_init(function()
|
stead.module_init(function()
|
||||||
input.cursor = '_'
|
input.cursor = '_'
|
||||||
|
input.inp_xlat = true
|
||||||
input.key = stead.hook(input.key,
|
input.key = stead.hook(input.key,
|
||||||
function(f, ...)
|
function(f, ...)
|
||||||
local r = input_kbd(...)
|
local r = input_kbd(...)
|
||||||
|
|
Loading…
Reference in a new issue