click module

This commit is contained in:
p.kosyh 2010-06-07 13:53:00 +00:00
parent 0111f5fd5a
commit 3679c69022
4 changed files with 17 additions and 1 deletions

2
debian/changelog vendored
View file

@ -11,7 +11,7 @@ instead (1.2.0) unstable; urgency=low
* hook and inherit;
* entered/left human friendly actions;
* stead.cmd, stead.args added;
* require added (module goto);
* require added (modules: goto, xobj, input, click);
* aligned width for themes/games dialog;
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 01 Jun 2010 17:40:00 +0300

View file

@ -11,6 +11,7 @@ install:
$(INSTALL) goto.lua $(STEADPATH)/goto.lua
$(INSTALL) xobj.lua $(STEADPATH)/xobj.lua
$(INSTALL) input.lua $(STEADPATH)/input.lua
$(INSTALL) click.lua $(STEADPATH)/click.lua
uninstall:
$(RM) $(STEADPATH)/stead.lua

View file

@ -8,3 +8,4 @@ install:
copy goto.lua ..\bin\stead
copy xobj.lua ..\bin\stead
copy input.lua ..\bin\stead
copy click.lua ..\bin\stead

14
stead/click.lua Normal file
View file

@ -0,0 +1,14 @@
input.click = function(s, press, mb, x, y, px, py)
if press and px then
return "click "..px..','..py;
end
end
game.action = hook(game.action,
function(f, s, cmd, x, y, ...)
if cmd == 'click' then
return call(here(), 'click', x, y);
end
if f then return f(s, cmd, x, y, unpack(arg)) end
end)