PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Oct 01 2018, 1:52 AM PST

The below example, assuming that ‘mouse’ was defined, would print the key that was pressed (e.g. “q”) along with the ascii value for that key (e.g. 113).

local function onKeyDown( key )
    print("Key:", key, " Code:", string.byte(key))
end
mouse.KeyDown:Connect(onKeyDown)