Page 1 of 1

examinekeyboard needs open(window)screen ?

Posted: Tue Jan 22, 2013 4:58 pm
by sartic
If Not(InitKeyboard())
End 99
EndIf
If ExamineKeyboard()
If KeyboardReleased(#PB_Key_Pause) Or KeyboardReleased(#PB_Key_Scroll)
Break
EndIf
EndIf

there is no explanation in help.
strange thing it works compiled on my system but it gives error on run.

ps: in help file there is no result for examinekeyboard so there is no need for if in this program?

Re: examinekeyboard needs open(window)screen ?

Posted: Tue Jan 22, 2013 7:34 pm
by netmaestro
The keyboard library docs do say it depends on DirectX but they should really go on to say a screen needs to be open as well, that seems to be a deficiency in the help file.

Re: examinekeyboard needs open(window)screen ?

Posted: Tue Jan 22, 2013 9:31 pm
by luis
Isn't reported by the debugger ?

"OpenScreen() or OpenWindowedScreen() must be called before using any Keyboard commands."

Anyway a mention in the manual wouldn't hurt.

Re: examinekeyboard needs open(window)screen ?

Posted: Thu Jan 24, 2013 9:25 am
by sartic
yes, it is. but works on my system, crashing on other without openscreen (it depends on initsprite etc...)
i will investigate how to check for key input without dx.