Hi
How can i get one key when user press that in keyboard ?
Get keyboard press key
To check one special key, use this commands:
Code: Select all
initkeyboard()
;inits and co.
;start-mainloop
examinekeyboard()
if keyboardpushed(#PB_Key_Space)
;do this, after key-space was pushed
endif
;end-mainloop
Remember when you use the above InitKeyboard(), ExamineKeyboard(), etc.. DirectX v7+ must be installed! You can use the Win32 API to avoid the need of having DX installed. See: viewtopic.php?t=9437 I think there was a native command added in v3.90 to do this, check the history.txt file and Reference.Sunny wrote:To check one special key, use this commands:Code: Select all
initkeyboard() ;inits and co. ;start-mainloop examinekeyboard() if keyboardpushed(#PB_Key_Space) ;do this, after key-space was pushed endif ;end-mainloop
you would probably have to use somethign like this:
note: I don't think this will only work if you open a (windowed)screen..
Code: Select all
a.l = 0
Repeat
ExamineKeyboard()
If KeyboardPushed(#PB_KEY_SPACE)
a +1
EndIf
Until KeyboardPushed(#PB_KEY_ESCAPE)
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
then you can do a search on this forum for an api call byt the name of GetASyncState or GetASyncKey or something like that.. someone else may ellaborate on this some more..
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX