| |
Laxity
Registered: Aug 2005 Posts: 459 |
Detecting ctrl and shift pressed simultaniously
OK.. here goes.
I need to find out if it's possible to detect simultanious key presses of both Ctrl and shift (both left and or right). The code I've written for detecting this works nicely in Vice, but the question is if the key matrix of the real c64 hardware allows this?
Unfortunately my 64 is broken, so I'm unable to investigate this myself. |
|
... 24 posts hidden. Click here to view all posts.... |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
shift lock can be detected and distinguished from the other shift keys (even though it "shouldn't" be possible).. Marko Mäkeäkkölälälä wrote some strange routine to take care of that.
I tried it and it worked.
Not that this was the topic really, but anyway... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
its called kernal.
secondly IMHO kernal has neat routines to read the keyboard, why should one waste time and memory for that ? Altho in this case kernal probably wouldnt do. |
| |
Style
Registered: Jun 2004 Posts: 498 |
wow, you can detect the difference between shift and shift lock?
How? any details?
They should be equivalent! |
| |
Laxity
Registered: Aug 2005 Posts: 459 |
Quote: As far as I know you can check CTRL, shiftR, shiftL by using $dc00 and $dc01...
Well any keycombination should be possible this way, apart from RESTORE.
I'm doing just that. I wanted to know if the physical key matrix would allow detection of shift and ctrl at the same time :) |
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now. |
| |
iopop
Registered: Dec 2001 Posts: 317 |
Quote: There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now.
its Krestology 100% - as if you ever wanted to hold the parts in that one anyhow.. :) |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Krestology may be the demo - it has a big finger pressing it very early.
LAxity:Yes you can via the link I gave earlier. The biggest issue is if three keys in the grid that align so that you make 3 points of a square (using 8*8 grid) then a 4th key press is registered. Maybe with some clever coding you can eliminate the ghost press. From the link at Joe's site if you pressed 3, 5 and W then R would also be detected even if not pressed. |
| |
Style
Registered: Jun 2004 Posts: 498 |
Quote: There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now.
and not the corresponding shift key? |
| |
Laxity
Registered: Aug 2005 Posts: 459 |
Quote: Krestology may be the demo - it has a big finger pressing it very early.
LAxity:Yes you can via the link I gave earlier. The biggest issue is if three keys in the grid that align so that you make 3 points of a square (using 8*8 grid) then a 4th key press is registered. Maybe with some clever coding you can eliminate the ghost press. From the link at Joe's site if you pressed 3, 5 and W then R would also be detected even if not pressed.
Yes, I saw your link. I'm already detecting key presses using $dc00 and $dc01 and it works like a charm. No problem there... Multiple key presses and all is good. Was just wondering as I said a few times already :), if the physical hardware would allow for the combination of shift and control being pressed simulaniously, and apparently it does.. So there's much rejoycing ;) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: wow, you can detect the difference between shift and shift lock?
How? any details?
They should be equivalent!
From Markos article in C=Hacking #7:
Quote:
The difference between an input and an output is that an output uses more current to drive the signal to the desired level. An input and an output outputting logical '1' are equivalent for any other inputting chip. But if a chip is trying to drive a signal to ground level, it needs more current to sink an output than an input. You can even use outputs as inputs, i.e. read them in your program.
You can use this feature to distinquish between the left shift and the shift lock keys, although they are connected to same hardware lines. The shift lock key has smaller resistance than the left shift. If you make both CIA 1 ports to outputs (write $FF to $DC03 and $DC01) prior reading the left shift key, only shift lock can change the values you read from CIA 1 port B ($DC01).)
|
Previous - 1 | 2 | 3 | 4 - Next |