Is there a way to use the "keyboard_check_direct();" to check if a key is released
I am making something that records a voice while a key is pressed and stops when the key is released.
It works using game maker's in built commands to check pressed and released but I want to do this outside of gm.......
Key board check direct released
Started by master123, Jul 02 2012 04:37 AM
3 replies to this topic
#1
Posted 02 July 2012 - 04:37 AM
#2
Posted 02 July 2012 - 04:48 AM
ok do this
you have to wirite them all in code 1.so if A,B C are the required keys,do this
if press=1
{
if keyboard_check_direct(ord('A')
.
.
.
}
if !keyboard_check_direct(ord('A') and ....//code 1(for down explanation)
{
a=1
}
else
a=0you have to intialize a,and this will not work if multiple keys are pressed at once,also,if your needed keys are A,B,C,Dyou have to wirite them all in code 1.so if A,B C are the required keys,do this
if !keyboard_check_direct(ord('A') and !keyboard_check_direct(ord('B') and !keyboard_check_direct(ord('C'))for some reason,i feel you are making a keylogger.
Edited by ZyklonMiraj, 02 July 2012 - 04:50 AM.
#3
Posted 02 July 2012 - 06:10 AM
ok do this
if press=1 { if keyboard_check_direct(ord('A') . . . } if !keyboard_check_direct(ord('A') and ....//code 1(for down explanation) { a=1 } else a=0you have to intialize a,and this will not work if multiple keys are pressed at once,also,if your needed keys are A,B,C,D
you have to wirite them all in code 1.so if A,B C are the required keys,do thisif !keyboard_check_direct(ord('A') and !keyboard_check_direct(ord('B') and !keyboard_check_direct(ord('C'))for some reason,i feel you are making a keylogger.
Thanks, but where do you put the code for pressed and released to be executed?
Also will this code work when a key is being hold and released?
#4
Posted 02 July 2012 - 09:10 AM
Step Event of any object.This code will only work with one key pressed at a time,if multiple keys are pressed,it will only read one.
Edited by ZyklonMiraj, 02 July 2012 - 09:11 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











