Elysium scripting Editor API index
Build

Input

Keys, the mouse, the cheat's own hotkeys - and the virtual key numbers that go with them.

Scripts get input in three ways, and which one to use depends on what you want:

For anything a person will configure, prefer the key control: the user picks the key, it is saved, and the script contains no hard-coded key at all.

local show = ui.group( "overlay" ):key( "show key", input.vk.f4, "toggle" )

on( "frame", function( canvas )
	if show:get( ) then
		canvas:text( 20, 20, "visible", color( 255, 255, 255 ) )
	end
end )

#Asking

#input.down( key ) → boolean

Whether the key is held right now. key is a virtual key, usually written input.vk.space. The mouse buttons are keys too: input.vk.mouse1 is the left button. Keys held while some other window has the focus are not reported - the script sees input only while the game is in front.

#input.pressed( key ) → boolean

true once, on the call that sees the key go down. Each script remembers, per key, what it saw the last time it asked, so the answer depends on the calls this script makes: ask from one place per key. Two handlers that both call input.pressed( input.vk.f5 ) take turns catching the edge.

#input.released( key ) → boolean

true once when the key comes up. It shares its memory with input.pressed for the same key.

on( "frame", function( canvas )
	if input.pressed( input.vk.f6 ) then
		ui.notify( "F6" )
	end
end )

#input.mouse() → x, y

The mouse cursor's position in the game window, in pixels from its top left corner.

#input.focused() → boolean

Whether the game window has the keyboard focus.

#input.key_name( key ) → string

A readable name for a virtual key - what the menu shows on a key button.

#input.hotkeys() → list

The cheat's own hotkeys: every setting that has a key bound, in the order they were registered, as { name, category, key, key_name, mode, active } - useful for drawing a list of what is currently bound and which binds are active.

on( "frame", function( canvas )
	local y = 200

	for _, bind in ipairs( input.hotkeys( ) ) do
		if bind.active then
			canvas:text( 20, y, bind.name .. "  [" .. bind.key_name .. "]", color( 255, 255, 255 ) )
			y = y + 16
		end
	end
end )

#Virtual keys

Keys are identified by the numbers Windows calls virtual-key codes. input.vk has a name for each one a script is likely to want, so you never need the numbers:

NamesKeys
input.vk.a ... input.vk.zthe letters
input.vk.n0 ... input.vk.n9the number row
input.vk.f1 ... input.vk.f12the function keys
input.vk.numpad0 ... input.vk.numpad9the numeric keypad
mouse1, mouse2, mouse3, mouse4, mouse5left, right and middle button, and the two side buttons
shift, ctrl, alteither side; lshift, rshift, lctrl, rctrl, lalt, ralt for one side
space, enter, escape, tab, backspace, capslock, pause
left, up, right, downthe arrow keys
insert, delete, home, end_key, pageup, pagedownthe navigation block

end_key is called that because end is a Lua keyword and cannot follow a dot. All the values are plain integers, so input.vk.space == 32, and a key code received in an input message compares directly against them.

on( "input", function( msg )
	if msg.kind == "key_down" and msg.key == input.vk.f9 and not msg.repeated then
		print( "F9 pressed" )
	end
end )
Elysium scripting guide · built 2026-10-03