steed/stead/hotkeys.lua

22 lines
419 B
Lua
Raw Normal View History

2010-07-06 12:56:02 +03:00
require 'kbd'
stead.module_init(function()
hook_keys('1','2','3','4','5','6','7','8','9','0');
end)
game.kbd = stead.hook(game.kbd, function(f, s, down, key, ...)
if down and key >= '0' and key <= '9' then
if isDialog(here()) then
2010-07-26 22:29:08 +03:00
if key == '0' then key = '10' end
2010-07-06 12:56:02 +03:00
local p = seen(key);
if p then
2011-07-27 13:21:20 +03:00
return stead.call(p, 'act');
2010-07-06 12:56:02 +03:00
end
end
return
end
2011-02-23 12:11:27 +02:00
return f(s, down, key, ...);
2010-07-06 12:56:02 +03:00
end)
2010-07-06 13:15:27 +03:00
-- vim:ts=4