Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function keyCheck()
- local sTimer = "placeholder"
- local seTimer = "placeholder"
- local allowChar = false
- local shiftPressed = false
- while true do
- local event, char = os.pullEvent()
- if event == "key" and char == 42 then
- shiftPressed = true
- seTimer = os.startTimer(0.7)
- elseif event == "key" and char == 29 then
- allowChar = true
- sTimer = os.startTimer(0.7)
- elseif event == "key" and allowChar then
- local name = nil
- for k,v in pairs(keys) do
- if v == char then
- if shiftPressed then
- print("Ctrl+" .. "Shift+" .. k:upper())
- else
- print("Ctrl+" .. k:upper())
- end
- end
- end
- elseif event == "timer" and char == sTimer then
- allowChar = false
- elseif event == "timer" and char == seTimer then
- shiftPressed = false
- end
- end
- end
- keyCheck()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement