Keyboard without Screen? Possible!

Advanced game related topics
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Keyboard without Screen? Possible!

Post 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
Image
Fred
Administrator
Administrator
Posts: 16623
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Keyboard without Screen? Possible!

Post by Fred »

It's because it uses directX on Windows, which shouldn't be requiered for normal application.
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Keyboard without Screen? Possible!

Post 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
Image
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Keyboard without Screen? Possible!

Post 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
Post Reply