Page 1 of 1

Keyboard without Screen? Possible!

Posted: Wed Oct 15, 2014 9:34 am
by Bananenfreak
Heyho,
my Debugger was disabled and I compiled a code like this:

Code: Select all

;-Compile this without Debugger
EnableExplicit


Define.i event, Quit


InitSprite()
InitKeyboard()


OpenWindow(#PB_Any, 0, 0, 1800, 1000, "AudioIn-Out Test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)


Repeat
  Repeat
    event = WindowEvent()
    
    Select event
      Case #PB_Event_CloseWindow
        Quit = 1
        
    EndSelect
    
  Until event = 0
  
  If ExamineKeyboard()
    
  EndIf
  
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1

End
It runs perfect, if I push Escape program stops normal.
But when I enable Debugger, it says I have to open a Screen. But why I should do this? It works even without Screen Oo

Is there any reason why I must open a Screen for mouse- and keyboardthings?

Greets,
Bananenfreak

Re: Keyboard without Screen? Possible!

Posted: Wed Oct 15, 2014 9:43 am
by Fred
It's because it uses directX on Windows, which shouldn't be requiered for normal application.

Re: Keyboard without Screen? Possible!

Posted: Fri Oct 17, 2014 10:45 am
by Bananenfreak
So on Windows there is no problem with Mouse and Keyboard without Screen... what about deleting that red alert and adding a warning instead of it?
It would be great to use Keyboard without screen in a larger project WITH debugger

Re: Keyboard without Screen? Possible!

Posted: Wed Dec 03, 2014 12:25 pm
by Mistrel
Here is a work-around for using the keyboard library with and without the debugger:

http://purebasic.fr/english/viewtopic.php?f=12&t=61127