No 'Pause' key?'

Blitz3D Forums/Blitz3D Programming/No 'Pause' key?'

John Blackledge(Posted 2005) [#1]
Blitz does not react at all to Keyhit(197) or Keydown(197) - the 'pause' key. Simply no acknowledgement that it's been pressed.
Mark's scan code page in the helps shows it.
Anyone know the answer?


Ross C(Posted 2005) [#2]
Certain keys on the keyboard just aren't picked up. Dunno whether it's just a blitz thing though. The NumLock key isn't picked up either. Dunno whether it's a blitz thing as i say, or keyboard thing, as my NumLock key doesn't actually do anything anyway :o)


DJWoodgate(Posted 2005) [#3]
I just did a complete scan and it is 69 on my keyboard and numlock is 197. Could be one of those regional things.

Oh and numlock state can be toggled when using getkey and the like though it is otherwise ignored by blitz as far as I can see. Anyway the API keyboard functions give fuller control, though they are not as easy to use.


Maximus Primal(Posted 2005) [#4]
Blitz has a HUGE problem with my F keys as I have an extra key that gives them a double use. For some reason I normally have to press this key twice before Blitz will reconise any of my F keys. Perhaps if your keyboard has extra non-standard keys that may be part of the problem?

Max


John Blackledge(Posted 2005) [#5]
Yes, it's got all those stupid multimedia keys (which I never use).
But I thought a scan code - was a scan code.
Is Blitz just not scanning for certain keys on certain keyboards?

Oh I just realised what you meant DJ.
In effect the API keybord drivers are like a translation table, so no matter what scan code is produced by a key, the API sends the correct message e.g. Numlock into the system?

This actually make things a little scary - that we can't (at least for some keys) rely on the Blitz scan code definitions.

I just need to be able to pause my app until pause is pressed again - nothing complex, just a small loop. But I don't want to have to use any of the more 'important' keys for this; all 3D apps such as games use the Pause key, so I want to as well.

If nothing else, does anyone know of a Blitz (API) lib which could achieve this?


DJWoodgate(Posted 2005) [#6]
Well I was just guessing about the regional thing. In fact in retrospect that seems a bit daft, Ascii values might be reassigned but scancodes should stay the same for different regions. Maybe the docs are just wrong, or Blitz is just translating the scancode incorrectly. So maybe it was always meant to be 197 as per the docs but somewhere along the line it was mixed up with the code for Numlock. Mark is always fiddling with things so this could have occured since the docs were written.

In fact I seem to remember the function of Print Scrn being changed at some point. My guess is this is when the code for Pause was inadvertently changed. Apparently these keys are a bit "special". http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html#ss1.1
Just a brief glance at that document suggests that scancode translation is a nasty business.

So I would use 69, unless you get indication that some people do have the Pause key returning a scancode of 197 in which case it would be time to think again. I have changed my docs to suit.


John Blackledge(Posted 2005) [#7]
Anyway, this works:

If KeyHit(KEY_PAUSE) Or KeyHit(KEY_NUMlOCK)
FlushKeys
Repeat
Flip
Until KeyHit(KEY_PAUSE) Or KeyHit(KEY_NUMlOCK)
FlushKeys
Endif

Thanks, guys.