keypresses without a gfx window (not maxgui)

BlitzMax Forums/BlitzMax Beginners Area/keypresses without a gfx window (not maxgui)

Nate the Great(Posted 2009) [#1]
Hi I just tried to write a program that still needs to input keypresses while going in and out of windowed mode (hidden mode and fullscreen), however I can't get it to recieve keypresses out of windowed mode :( is this impossible with blitz? I also noticed this with winb3d for b3d


Nate the Great(Posted 2009) [#2]
I also read something about the pollsystem command but I couldnt figure out how to use it


Dabhand(Posted 2009) [#3]
It is possible in BlitzMax to pickup keypresses in a keylogging kind of way, though, you need Win32 to do it using global keyboard hooks, I'm not sure on mac/linux mind.

Be warned though, AV software may (should) go crackers when you try to establish the hook.

Dabz


Nate the Great(Posted 2009) [#4]
oh I meant in full screen mode as well as when there is no window. I figured it was the same problem

hmm how would I use the win32 dll? I dont know about all of those functions


Gabriel(Posted 2009) [#5]
Sorry, but are you saying that you don't get any input in fullscreen? So, for example, this doesn't quit when you press escape?

Graphics(1280,1024,32)

Repeat
	Cls
	Flip
Until KeyHit(KEY_ESCAPE)


Change the resolution if you need to, obviously.


Dabhand(Posted 2009) [#6]
What do you actually need this for... And do really need to catch keyboard events when the window is hidden?

A typical usage for this is to hide a application thats working on a task, then if the user wants to look at the progress he can hit a specified key(s), as an example F2 or Ctrl+M etc etc

Global keyboard hooks are the way to do that, but by their nature... They are a very shady area in programming and some AV software go ballistic at the near sniff of a global keyboard hook... So its best to keep well out of the way of them.

If you are wanting to bring the window back from its hidden state, or exit it, you could use the notification area, I'm sure theres loads of stuff on the forum you could look at... Thats where I would head.

But, if theres some other reason, and you MUST have global keyboard hooks, then a little google research wouldnt go amiss.

Dabz


Nate the Great(Posted 2009) [#7]
to clarify I was using this in a game and it was full screen but then I tried all the different gfx modes full, windowed, and no window. My computer is so screwy I cant even log in to this website so I had to use another computer thnx for the help but I think my computer just went wacko.. in fact nothing worked after I got that bug


Dabhand(Posted 2009) [#8]
Oh well... technology... handy... but alas, a mighty chew on at times! ;) hehehe

Dabz