Page 1 of 1
[SOLVED] Handling enter key - overriding default chat enter
Posted: 12 Apr 2014, 09:41
by gajop
1. Is it possible to handle the "Enter" key press somehow? Seems like it's being captured by the engine and used to start/stop typing a chat message, but it doesn't get passed to widgets (or at least some widget could be capturing it before mine).
2. It seems the numpad "Enter" key is never being passed, but it doesn't work for chat message typing either.
Re: Handling enter key press - overriding default chat enter
Posted: 12 Apr 2014, 10:37
by gajop
Nevermind, I was doing something wrong, not sure what that was.
PS: for future reference, it seems the numpad enter is 271 (KP_ENTER), while the normal enter is 13 (ENTER).
Re: Handling enter key press - overriding default chat enter
Posted: 12 Apr 2014, 11:51
by jK
please stop comparing symkeys, instead compare the string name of it.
It was a lot work to fix those symkeys in the SDL2 switch, cause they changed and aren't said to be stable at all ...
Re: Handling enter key press - overriding default chat enter
Posted: 12 Apr 2014, 11:57
by gajop
jK wrote:please stop comparing symkeys, instead compare the string name of it.
Sure, but how?
In Chili's editobox.lua 'Spring.GetKeyCode("backspace")' is mentioned (I guess you wrote that), but spring 96.0 tells me that function doesn't exist.
Re: [SOLVED] Handling enter key - overriding default chat en
Posted: 12 Apr 2014, 12:02
by jK
http://springrts.com/wiki/Lua_UnsyncedR ... ot-.29Keys
it's not new
and you can also use Spring.GetKeySymbol
Re: [SOLVED] Handling enter key - overriding default chat en
Posted: 12 Apr 2014, 12:42
by gajop
OK, seems to actually work, thanks.