- Joined
- Oct 11, 2012
- Messages
- 711
How to capture the ACSII Dec number of a hot key? For example, when I press "space" in the game, a message of "126" would be displayed. 126 means "space" in ACSII.
Thanks a lot!
Thanks a lot!
You can't detect key events natively in Wc3 aside from arrow keys.
You can however make a spellbook with ability with the hotkey of the key you're trying to detect.
That's kind of hacky though.
Alright. So what is the purpose of Bribe's system?
Edit:
I also want to know how is this possible as Dark_Gandalf said:
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/detect-keys-jass-186864/#post1811674
About the spellbook method--sadly it is an old myth that doesn't actually work.![]()
Items are hotkeyed to the numpad and you can give abilities the hotkey you want. Then just detect "A unit uses an item" and "Unit begins casting an ability" events.
Bribe's system is useful for anything that deals with strings/characters. It allows you to map characters to an array instead of reading/loading from a hashtable. It still ends up using StringHash() and some division though, so it might not offer much of a speed benefit. For example, my WordWrap/StringSize system maps character sizes to an array with the ascii values as indexes.
About the spellbook method--sadly it is an old myth that doesn't actually work.![]()
Well, it works but you can't detect key holding (releasing too, obviously).