Forum

> > CS2D > Scripts > Keyboards and key hook
Forums overviewCS2D overview Scripts overviewLog in to reply

English Keyboards and key hook

4 replies
To the start Previous 1 Next To the start

old Keyboards and key hook

hyesosivixd
User Off Offline

Quote
How to detect specific keys like
[
,
]
,
'
,
\
.

And how display symbol
;
in hudtxt command
edited 2×, last 05.06.21 11:35:15 am

old Re: Keyboards and key hook

DC
Admin Off Offline

Quote
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.

old Re: Keyboards and key hook

Bowlinghead
User Off Offline

Quote
Tell people to bind something on these keys:
1
bind "[" "!say '['"
with
1
2
3
4
5
6
addhook("say","hee")
function hee(id,txt)
if (txt == "!say '['") then
	-- bring the action
end
end

old Re: Keyboards and key hook

Gaios
Reviewer Off Offline

Quote
@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
Log in to reply Scripts overviewCS2D overviewForums overview