home *** CD-ROM | disk | FTP | other *** search
-
- ;key differentiation
-
- ;code by reiner richter
- ;(c) copyright, not
-
- ;this is some demo code to distinguish
- ; between different key combinations
- ; that notmally give the same ascii
- ; result.
-
-
- chrout = $ffd2 ;kernal output char
- getin = $ffe4 ;kernal get char
-
- lstx = 197 ;current key pressed
- shflag = 653 ;keyboard shift key
- ;1=shift
- ;2=commodore
- ;4=control
-
-
- *= $4000
-
-
- cli
- ldx #0
- loop lda introtxt,x ;print intro
- beq waitloop ; text so you
- jsr chrout ; know what to
- inx ; do.
- bne loop
- waitloop jsr getin ;wait until the
- cmp #19 ; appropriate
- bne waitloop ; key is pressed.
- ldx #0
- lda shflag ;check for
- and #4 ; control key.
- beq noctrl
- ldx #txtctrls-txthome
- noctrl lda txthome,x
- beq exit ; text so you
- jsr chrout ; know what to
- inx ; do.
- bne noctrl
- exit rts
-
- introtxt .byte 147
- .text "press home or "
- .text "control s..."
- .byte 13,0
-
- txthome .text "home was pressed."
- .byte 0
-
- txtctrls .text "control s was pressed."
- .byte 0
-
-