Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Detecting ctrl and shift pressed simultaniously
2006-03-04 08:03
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....
 
2006-03-04 14:28
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...
2006-03-04 18:01
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.
2006-03-05 07:47
Style

Registered: Jun 2004
Posts: 498
wow, you can detect the difference between shift and shift lock?

How? any details?

They should be equivalent!
2006-03-05 08:29
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 :)
2006-03-05 08:33
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.
2006-03-05 08:48
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.. :)
2006-03-05 08:50
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.
2006-03-05 09:14
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?
2006-03-05 10:43
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 ;)
2006-03-05 11:08
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
zscs
Acidchild/Padua
Magic/Nah-Kolor
Jazzcat/Onslaught
Youth
Zorch
Guests online: 85
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.