From e57a13a248f47264263e449dd567b134edde8b5f Mon Sep 17 00:00:00 2001 From: Bukz Date: Tue, 12 Jun 2012 11:18:13 +0000 Subject: [PATCH] Testing new native alias "KEYPRESS" git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6835 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/console.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/src/console.cpp b/source/src/console.cpp index 428c8f5c..271c4128 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -551,6 +551,11 @@ void keypress(int code, bool isdown, int cooked, SDLMod mod) { if(haskey) execbind(*haskey, isdown); } + if(isdown && identexists("KEYPRESS")) // TODO: Remove this if its misued. e.x: /KEYPRESS = [ echo You pressed key code: $arg1 ] // Output: You pressed key code: 32 (if you press the spacebar) + { + defformatstring(kpi)("KEYPRESS %d", code); + execute(kpi); + } } char *getcurcommand()