|Martin Fabik (Hungar)||10.06.2016 21:53|
I'm trying to create script, that will allows you to create your own note with your custom text. I need to assign backspace for deleting text from note. At first I tried to read unicode number of backspace in keyEvent callback, but all special keys (such as ctrl,alt,backspace,etc...) have number "0". So I tried to create my own input binding for this. I've tried KEY_backspace and KEY_bs - both without success.
My InputBindings in modDesc.xml:
<input name="notesOpenClose" category="ONFOOT" key1="KEY_r" button="" />
<input name="notesDeleteNote" category="ONFOOT" key1="KEY_backspace" button="" />
And in LUA code:
if InputBinding.hasEvent(InputBinding.notesDeleteNote) then
print("Delete some text");
If I set KEY_delete as key1 in inputBindings it works. Can anyone help me?
|Emil Drefers (Unknown)||13.06.2016 06:41|
did you have a look at the values of 'sym'?
function MyMod:keyEvent(unicode, sym, modifier, isDown)
|Martin Fabik (Hungar)||13.06.2016 21:20|
thanks a lot for tip. It helped me a lot :)
Note: Log in to post. Create a new account here.