6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 22, 2024 5:41 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Query the keyboard
PostPosted: Sat Aug 15, 2020 7:49 pm 
Offline

Joined: Wed Aug 12, 2020 2:30 am
Posts: 43
After many searches that result in almost as many methods, I'm still stuck here.

I've tried reading $ff, the scnkey kernel routine, reading the cia directly, etc...

Any help guys?


Top
 Profile  
Reply with quote  
 Post subject: Re: Query the keyboard
PostPosted: Sat Aug 15, 2020 8:34 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
I'm guessing you may be using a Commodore 64, but you should keep in mind that if you include essential information like the computer you're using you'll probably get better answers.

After calling SCNKEY, which scans the keyboard but does not return anything, try calling GETIN to get the key that was scanned.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
 Post subject: Re: Query the keyboard
PostPosted: Sat Aug 15, 2020 8:49 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 890
If you are using a Commodore 64, as long as the C64's interrupt service routine is running, SCNKEY is performed by the ISR.
All you need to do is call GETIN at $FFE4.
GETIN returns zero in the accumulator if no key has been pressed so you may want to run a loop that calls GETIN until a non zero value is returned.


Top
 Profile  
Reply with quote  
 Post subject: Re: Query the keyboard
PostPosted: Sat Aug 15, 2020 10:25 pm 
Offline

Joined: Wed Aug 12, 2020 2:30 am
Posts: 43
Thanks guys. And yes... C64. Sorry about not mentioning it.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: