No, it is not caused by third party libraries, because it behaves the same
way in all emulators I tested. It means that the root of this evil must be
inside keyboard hardware or keyboard driver or any other driver in my
Windows, because Windows drivers can generally corrupt other drivers in
Windows. (This is well known fact - I remember unbelievable situations when
driver of a totally unrelated hardware caused changes in behaviour of other
unrelated devices in Windows.)
Normally in DirectInput the keys send a single KEYDOWN event, then they send
nothing as you hold the key down, and then they send a single KEYUP event. I
wrote this differntly in my previous email, but this is the right
description. Unfortunately, my capslock behaves like your Apple caps lock,
and in addition it keeps sanding weird sequence of UP-DOWN-UP-DOWN... events
when I hold it for a while.
Also, I tested it in VMware on the very same computer and it behaves
normally, i.e. the same way as other keys. So I think the hardware isn't
root of this evil, it must be some driver in my Windows. Unfortunatelly, no
other people tested it yet, so I am a bit alone in it a.t.m.
/---
Aley
-----Původní zpráva-----
From: Thomas Harte
Sent: Tuesday, April 10, 2012 12:08 AM
To: [email protected]
Subject: Re: Weird caps lock behaviour
I'm not a Windows user so am unable directly to comment, but is SDL or
some other cross-platform library possibly contributing to the
confusion?
Here in Mac world the caps lock key is a special case. It sends a key
down when caps lock is engaged and a key up when caps lock is
disengaged. That was originally because original Mac keyboards had a
caps lock key with a little latch, like a pen with a button, so that
you pressed it once and it stayed down, you pressed it again and it
popped back up, and I guess it continues because Apple don't consider
it sufficiently worrisome to be worth the mild breakage.
Slightly boring history lesson of a minority platform aside, when last
I checked SDL handled this problem by emulating Mac behaviour on all
platforms. It looks like in ye olde ASCD you used Allegro. I doubt
those guys had any particular strategy for handling this, and even if
they did they probably got it wrong, then squabbled over maintaining
DOS support ten years after the fact.
So, anyway: is there any possibility that either you and other authors
are seeing differing results because some are using cross-platform
libraries that attempt to reconcile Mac and PC behaviour?
On 8 April 2012 12:43, Aleš Keprt <[email protected]> wrote:
Hi Sam users!
I encountered a weird caps lock behaviour, and I'd like you to test it too
and let me know whether you encounter the same problems or not. On my
computer all emulators I tested have got problem with caps lock - it
simply
doesn't work as expected. So I made changes to keyboard handling routine
in
ASCD 0.98 to let it work. And now this new version is the only emulator
where caps lock works correctly on my computer, but Simon Owen wrote me
that
on his computer it is different and ASCD 0.98 doesn't work correctly like
other emulators.
Please can you test it? If you compare ASCD 0.98 with SimCoupe, you should
clearly see difference in caps lock behaviour in Sam Basic. You can also
test older ASCD 0.98 WIP which uses the old (i.e. standard) caps lock
routine and will probably be similar to SimCoupe.
Download here:
http://www.keprt.cz/progs/ascd/ascd098.zip
http://www.keprt.cz/progs/ascd/ascd098wip3.zip
-------------------------------------------
Technical information follows:
Normally each key sends KEYDOWN when you press it, then it waits 250 ms
(this can be set in Windows) and then sends another KEYDOWN's as long as
you
hold down the key. The speed of autorepeat can be set in Windows as well,
normally it sends 30 KEYDOWN's per second on my computer (which is the
highest speed possible on a standard PC keyboard). Finally it always sends
a
single KEYUP when you release the key.
Caps lock sends initial KEYDOWN normally, then waits 250 ms (i.e. still
everything normal), but when you hold down the key longer, it starts to
send
weirdly KEYUP - KEYDOWN - KEYUP - KEYDOWN... etc. at 30 events per second
(i.e. 15x KEYUP and 15x KEYDOWN). When you release the key, the final
event
sent is based on the state of the green caps lock led on the keyboard. So
you
can never know if the final event will be KEYDOWN or KEYUP.
I use Windows 7 with plain standard PS2 keyboard driver, at least I think.
I
will definitely go and test it on other computers (I have a few old ones
at
home).
-----------------------------------------
Mgr. Aleš Keprt, Ph.D.
private: [email protected], www.keprt.cz
office: Moravian College / Moravská vysoká škola Olomouc,
[email protected]
-----------------------------------------
Mgr. Aleš Keprt, Ph.D.
private: [email protected], www.keprt.cz
office: Moravian College / Moravská vysoká škola Olomouc, [email protected]