Re: [cc65] Question on 1351 mouse

From: <silverdr1wfmh.org.pl>
Date: 2010-01-31 00:30:42
On 2010-01-30, at 23:43, Oliver Schmidt wrote:

> Hi,
>
> First I thought that there's a bug in VICE but after reading some docs
> I seem to understand that it is correct that the left mouse button
> corresponds to keyboard key(s).
>
> So if I press the left mouse button then "as a side effect" the key
> code 160 is detected by cgetc(). If I on the other hand press
> Shift-Space then "as a side effect" a left mouse button press is
> detected by the mouse driver. Is this the expected behaviour?

This is usually not the expected behaviour but it is the one we  
learned to live with. It is the result of hardware design of the 64,  
where keyboard and joystick/mouse ports are read using the same  
hardware lines. You can also achieve joystick movement using various  
keyboard combinations if you like.

>
> Does that mean that a program that allows the user to enter text (thus
> reaction on "all" keys) needs to filter out the key 160 to avoid
> garbage entered by mouse button presses? Or do I miss some point
> completely?
>

I wrote several programs with mouse interface, and (unless you are  
writing a word processor) it hardly ever interferes with keyboard  
entry. This is not only about the mouse. Plug a joystick into port 1  
and press FIRE plus jiggle the stick. The effects you get also hardly  
ever troubled people writing / using software on a 64 because most  
often people use either - or (joy/mouse - keyboard).

The only real problem I had with this hardware design was when I  
forgot once about it and wrote a driver for Atari's XEP-80 (eighty  
columns external display interface), which connects to a joystick port  
on the Atari. Of course I wanted it to connect to joystick port on a  
64 too. I connected it, wrote a nice handler and - after debugging -  
when it started to work I started to smile wide, until I realised that  
keyboard activity interferes with the output to the secondary screen,  
which made the whole effort kinda useless :-( One doesn't want garbage  
on the screen whenever some keys are pressed...

-- 
SD!
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Jan 31 00:30:55 2010

This archive was generated by hypermail 2.1.8 : 2010-01-31 00:30:58 CET