Jump to content
IGNORED

arrow keys off routine


Marius

Recommended Posts

Hi!

 

Is there a way of switching the Arrow Keys off?

 

I am writing a routine with some input fields. I don't want that the user can WALK over the screen with the cursor.

 

The only thing I can think of is check ROWCRS ($54) and COLCRS ($55, $56) all the time, and reset those registers when someone walks out of the range.

 

Break can be switched off by disableng the IRQ for that.

Is there such a solution for the ARROW keys too?

 

Thanks

M.

Link to comment
Share on other sites

There's a few things you could do:

 

1. On the XL/XE only, the keyboard definition table can be user-provided in RAM, so you could have an alternate map without cursor movement.

 

2. DIY keyboard IRQ routine that masks out cursor keys.

 

3. Easiest way - just use K: for input instead of E:, mask out the keys you don't want, then echo input to E:

Advantage there is you could also put a limit on input field size, disadvantage is you still need to handle Backspace, and you'd need to read the input off the screen once the user presses Return.

 

Problem with 1 & 2 is with cursor keys disabled you can still get runaway conditions e.g. where the user just enters hundreds of characters worth of input, but of course E: will never return more than 3 screen lines worth of data.

  • Like 1
Link to comment
Share on other sites

Use address $02FC.

 

INPUT
LDA #$FF
STA $02FC ; Reset register
LOOP
LDA $02FC ; CH  holds last key press
CMP #$06 ; left arrow
BEQ LOOP
CMP #$07 ; right arrow
BEQ LOOP
etc...
CMP #$FF ; No key pressed
BEQ LOOP
INPUT_ROUTINE_GOES_HERE
..
..
JMP INPUT

 

 

If you have a lot of keys you want to exclude it's better to create a table of internal key (characters) values and walk through that. Also, you need to input one character at a time in your routine, not whole words at once.

 

 

edit: readability...

Edited by Fox-1 / mnx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...