[Coco] Detecting Shift key.

Dave Philipsen dave at davebiz.com
Fri Sep 22 09:09:23 EDT 2017


That's a pretty crude debounce routine and for the original intention it's probably not needed. A more robust routine would do more than just check for the same result a couple of microseconds later.

Dave

> On Sep 22, 2017, at 7:36 AM, Johann Klasek <johann+coco at klasek.at> wrote:
> 
>> On Fri, Sep 22, 2017 at 12:06:04PM +0200, Tormod Volden wrote:
>>> On Fri, Sep 22, 2017 at 2:39 AM, Steven Wallis  wrote:
>> [..]
>> This will work on all machines to detect shift:
> 
> How about to debouce? Could this be done like this?
> Added the "wait for shift" line in case one waits until
> the shift key is pressed ...
> Would these modifications of any value?
> 
>> 
>>         ldb   #$7F         ; pull down row containing shift
>>         stb   $FF02
> wait
>>         ldb   $FF00
>           cmpb  $FF00
>           bne wait         ; debounce
>>         comb
>>         andb  #$40       ; check column containing shift
>           beq   wait       ; wait for shift
> 
>>         bne   gocmdl          ; return if shift key pressed
> 
> Johann
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list