English Keyboards and key hook

4 replies
Goto Page
To the start Previous 1 Next To the start
05.06.21 09:34:10 am
Up
hyesosivixd
User
Offline Off
How to detect specific keys like
[
,
]
,
'
,
\
.

And how display symbol
;
in hudtxt command
edited 2×, last 05.06.21 11:35:15 am
05.06.21 03:52:13 pm
Up
DC
Admin
Online On
Keys: Doesn't work, sorry.
cs2d lua cmd addbind
Only keys listed there are supported. Others are not.

Regarding semicolon in hudtxt: I guess you can't. Use : instead
CS2D's parsing is quite simple/bad and since semicolon is used to separate commands you can't use it.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
05.06.21 04:52:41 pm
Up
Bowlinghead
User
Offline Off
Tell people to bind something on these keys:
Code:
1
bind "[" "!say '['"

with
Code:
1
2
3
4
5
6
addhook("say","hee")
function hee(id,txt)
if (txt == "!say '['") then
     -- bring the action
end
end
Share time limited free games here
07.06.21 02:17:42 pm
Up
hyesosivixd
User
Offline Off
@user DC: So, what about user input, how allow input symbol
;
or should I prohibit it?

@user Bowlinghead: A rather impractical method.
07.06.21 03:13:40 pm
Up
Gaios
Security Supporter
Offline Off
@user hyesosivixd: You just can't use other inputs than:

• Numeric keys: "0", "1" ... "9"

• Alphabetic keys: "A", "B", ... "Z"

• Function keys: "F1", "F2", ... "F12"

• Mouse: "mouse1" (left click), "mouse2" (right click), "mouse3" (middle click), "mwheelup", "mwheeldown" (scrolling)

• Special/Modifier keys: "leftshift", "rightshift", "leftctrl", "rightctrl", "leftalt", "rightalt", "leftsys", "rightsys"

• Arrow keys: "leftarrow", "rightarrow", "uparrow", "downarrow"

• Others: "backspace", "tab", "clear", "enter", "escape", "space", "pgup", "pgdn", "end", "home", "select", "print", "execute", "screen", "ins", "del"

• Numpad/keypad: Same as above with "kp_" prefix. e.g. "kp_leftarrow", "kp_home", "kp_ins" etc., "kp_5" for center button
To the start Previous 1 Next To the start