Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
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 08:43
Laxity

Registered: Aug 2005
Posts: 459
Oh. Well, control should be registered on there too, if I'm not mistaken (bit 2).. .. So, if you're able to get 5 in location 653, I'm home safe.. ;)
2006-03-04 08:44
Style

Registered: Jun 2004
Posts: 498
Laxity: Yes, it should work I believe.

The c64 keyboard matrix allows you to detect most keys independently of each other, except for restore and shift lock.

(Edit: Dont use kernel junk - its a waste of time)
2006-03-04 08:46
Laxity

Registered: Aug 2005
Posts: 459
I'm not using the kernal.. Wrote my own input library to waste my time on something instead.. :)
2006-03-04 10:45
Soren

Registered: Dec 2001
Posts: 547
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.
2006-03-04 10:59
Style

Registered: Jun 2004
Posts: 498
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.


and shiftlock, which is a mechanical switch on the left shift?

Edit: Oh, and Laxity, dont forget to account for keybounce.
2006-03-04 11:18
Stryyker

Registered: Dec 2001
Posts: 468
Quote: and shiftlock, which is a mechanical switch on the left shift?

Edit: Oh, and Laxity, dont forget to account for keybounce.


I do believe Marko or someone had a bit of code that could detect shift-lock, left shift or right shift was used on some (all?) models.

http://sta.c64.org/cbm64kbdlay.html is helpful but won't let you detect if shift-lock or the shift key also mapped the same is pressed.
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 :)
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
Alakran_64
MAT64
csabanw
Zeus
Dylotic/Xenon
blitzed
Andy/AEG
rambo/Therapy/ Resou..
Acidchild/Padua
psych
MWR/Visdom
TPM/Silicon Ltd
Guests online: 120
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 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (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 Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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