Ive got my keyboard module written, and everything seemed to be working correctly, but when i use Keyboard.Triggered?(Input['Enter']) it doesnt work. I removed what I had for Triggered?(key) and I was wondering if anyone could tell me, or point me to another Keyboard script that it does work on.
This is what I got so far... (not the entire code, just the part that is causing the problem)
Okay,
Pressed? is for when a key is being held down.
Toggle? is to toggle a key.
Toggled? is to check if a key is toggled or not.
But I dont know what code is used to just press a key once, and then release it.
Thank you so much,
~Brian
This is what I got so far... (not the entire code, just the part that is causing the problem)
Code:
def Triggered?(key)
end
def Pressed?(key)
return true unless GetKeyState.call(Input[key]).between?(0,1)
return false
end
def Toggle?(key)
GetKeyState.call(Input[key]) & 0x01 == 1
end
def Toggled?(key)
return false unless GetKeyState.call(Input[key]) & 0x01 == 1
return true
end
Pressed? is for when a key is being held down.
Toggle? is to toggle a key.
Toggled? is to check if a key is toggled or not.
But I dont know what code is used to just press a key once, and then release it.
Thank you so much,
~Brian