Re: [hatari-devel] Joystick buttons config and sdl gui patches |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Joystick buttons config and sdl gui patches
- From: Robin Sergeant <robin.sergeant@xxxxxxxxx>
- Date: Mon, 7 Aug 2023 14:00:34 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691413246; x=1692018046; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=UWmj2X8a33l7pDxo58zQjYRrl02NJ67BD5U9ISwEP64=; b=ggs/cx/YYOA/Hc2csTBBf+uBrnzGix22k0CErOqZTiKqs5ia8sq1DRMqImEvkE+V7z nyKDM18huplYj2QZ4EiOmAcIo4x/dPukkYAMixwfFylf7ICVTV9t4GoM4EhoJ5EZ+uGI nSs8T+AOBZxg0HSvmWS3a+LNky0CUpcWlr/0Yad2WpKJ8R4p1c7Z+TTboL5KXyS6VvqV v1iSOXdkJBXTWBWx4aVU2vNFaAXYZQ6SghSoUSDjqseVx14G/eGSpncpnHOA4eHPiBPL fPRfGJ7IZyKkMvmn8SNY9DwLqKA5XwCkJ4T1XP6mcbwxMhuKMGVdT7rJrn3zIkpaS3cI ToBg==
Excellent, thanks Eero. Thanks also for the authors credit - it's
nice to be able to contribute to something!
Br,
Robin.
On Mon, 7 Aug 2023 at 13:51, Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I'll split your minro changes from patch 4 to your and my earlier
> patches, and push everything to repo.
>
> (I have few other changes on top of them now, so it's better to be in sync.)
>
> - Eero
>
> On 7.8.2023 15.30, Robin Sergeant wrote:
> > On Mon, 7 Aug 2023 at 09:58, Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
> >>
> >> Hi Robin,
> >>
> >> Patches look fine for me too, but GUI needs descriptions for the buttons.
> >>
> >> Attached patch adds that, generalizes mapping handling a bit by using
> >> array instead of separate variables, and notes the change in docs
> >> (manual not yet updated).
> >>
> >> Does it work OK for you?
> >>
> >>
> >> - Eero
> >>
> >> On 30.7.2023 11.46, Robin Sergeant wrote:
> >>> Hi,
> >>>
> >>> Please find the attached patches. The first just adds the config as
> >>> before, but with checks to allow for undefined buttons (with negative
> >>> indexes).
> >>>
> >>> The second adds a "Remap joystick buttons" button to the sdl joystick
> >>> dialog. This behaves like the existing "Define keys" button. The
> >>> user is guided to press each of the 3 buttons, but can also press the
> >>> ESC key for none (which results in a value of -1 being stored and the
> >>> button being ignored). The dialog looks like this:
> >>>
> >>> --------------------------------
> >>> Press joystick button 1
> >>> or ESC for none...
> >>>
> >>> (was: id 3)
> >>> --------------------------------
> >>>
> >>> And then after pressing button 0 (but before releasing):
> >>>
> >>> --------------------------------
> >>> Press joystick button 1
> >>> or ESC for none...
> >>>
> >>> (now: id 0)
> >>> --------------------------------
> >>>
> >>> So as I said, basically consistent with how "Define keys" currently works.
> >>>
> >>> Does this look ok, and can the patches be included? Obviously happy
> >>> to make any further tweaks or change the UI etc. I should probably
> >>> have sent the proposal first, but I got carried away with the coding
> >>> and wanted to figure out how the dialogs worked :-)
> >>>
> >>> Any feedback welcome!
> >>>
> >>> Cheers,
> >>>
> >>> Robin.
> >
> > Hi Eero,
> >
> > Super, thank you. I like the button descriptions, makes it much more
> > user friendly. I've just made a few last tweaks in a new patch (see
> > last attachment):
> >
> > - I've changed the widths so they match the lengths of the fixed
> > length strings. Not really important, but it helps to show that
> > things are centered when looking at the table.
> >
> > - I've added another condition to stop ESC key repeats being handled.
> > While trying to break it I noticed that if you hold ESC before opening
> > the dialog SDL keeps generating KEYDOWN events! Nobody would ever
> > actually do that, but still I think only handling the first KEYDOWN is
> > logical.
> >
> > - I've made your names array static as I think that might reduce stack
> > usage. Although these days the compiler probably generates the same
> > code! Also reduced the scope of the counter variable at the same
> > time.
> >
> > Hope that's all ok. To help others I am attaching all 5 patches in
> > order to this email. Patch 0004 is from Eero, and 0005 is hopefully
> > the last!
> >
> > Many thanks,
> >
> > Robin.
>
>