Re: [hatari-devel] Synching host mouse position to Atari mouse position

[ Thread Index | Date Index | More Archives ]

Le 08/11/2019 à 23:34, Eero Tamminen a écrit :

Nicolas, you've fixed IKBD emulation for some demos, any
comments on detecting changed mouse handler?


there's no mouse-only handler, it's mostly about replacing the whole ikbd's ROM with a custom program. In that case, when IKBD_Cmd_Execute is called, then it's quite likely a custom program was uploaded to ikbd's RAM and mouse/keyboard should be set back to their default hatari's behaviour.

Maybe that instead of changing line-A variables another solution could be to change IKBD_Cmd_ReadAbsMousePos to intercept the returned values, sync/scale them to the host and then really return the new absolute positions ?

This should work with all the tos, and even with game/demo that read mouse positions, because it's really like intercepting mouse at the HW level.


If we really want to include such a thing (I'm really not sure
whether we should), you need to add more sanity checks here (e.g.
whether x and y is within range of the display)

Attached is updated patch which does that check and also fixes
issues with the (already existing) mouse warping done on
resolution switches.

I changed warping to be done only when Hatari has/gets keyboard
focus.  This fixes bad warping for Hatari windows that are covered
by other windows, when using click-to-focus windowing policy.

I couldn't come up any way to fix it for focus-follows-mouse
windowing policy, as there's no portable method for finding out
whether Hatari window is fully visible, so I just documented
that in the manual page.

and maybe also add an option to disable this feature.

It's behind the already existing --mousewarp option, which
is enabled by default.

     - Eero

Mail converted by MHonArc 2.6.19+