[Linuxwacom-devel] libwacom: Mode-switches and libwacom API

2012-12-13 Thread Olivier Fourdan
Hi all,

It seems GNOME settings daemon was modelled after the I4, where you 
have multiple modes (4 on the I4) and a single mode-switch button.

Pressing the mode-switch will cycle between the mode, 1, 2, 3, 4, 1, 
2, etc.

The hardware on the 24HD is different, there are 3 modes per ring, and 
3 mode-switch buttons per ring. So of course, the user expects that 
pressing the first one will switch to mode 1, the second to mode 2 and 
the third to mode 3.

But GNOME setting daemon does not do that. it treats all modeswitch 
the same, so pressing any of the mode-switch buttons for the first 
ring will cycle between the mode (just like on the I4). That's wrong 
and definitely not what users would expect.

The data/wacom.example files reads:

-
   # The location of the various rings, if associated with a button
   # or buttons.
   # For example, a single button in the middle of the touchring, like
   # on the Intuos4 tablets. You will need to mention the number of modes
   # that the button allows if there isn't one button per mode.
   Ring=A
   RingNumModes=4
   # Or the 2nd touchring associated with 3 buttons like the Cintiq24HD
   Ring2=I;J;K
   # Implied, as we have 3 buttons for that ring
   Ring2NumModes=3

   # If the touchstrips have mode toggling through a button
   # like on the Cintiq 21UX2
   Touchstrip=A
   Touchstrip2=J
   # We assume the same number of modes for each of the touchstrips
   # if there is more than one
   StripsNumModes=4
-

So to distinguish between a single mode-switch button that toggles 
between multiple modes (like the I4), and multiple mode-switch buttons 
that select a given mode (like the 24HD), one has to count how many 
buttons have the *MODESWITCH flag and compare than against the number 
of modes for that same touchring/touchstrip?

Cheers,
Olivier.

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: Mode-switches and libwacom API

2012-12-13 Thread Bastien Nocera
On Thu, 2012-12-13 at 11:52 +0100, Olivier Fourdan wrote:
 Hi all,
 
 It seems GNOME settings daemon was modelled after the I4, where you 
 have multiple modes (4 on the I4) and a single mode-switch button.
snip
 The hardware on the 24HD is different

Blame work, which bought me the wrong kind of hardware.

Seriously though, support for the modeswitches was rushed in for GNOME
3.4 and and I4 was all I had with a modeswitch.

 But GNOME setting daemon does not do that.

gnome-settings-daemon's modeswitch code was only ever tested on an I4,
by me at least. It's probably wrong for anything else.


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: Mode-switches and libwacom API

2012-12-13 Thread Olivier Fourdan

Hi Bastien,

Bastien Nocera said the following on 12/13/2012 12:12 PM:
 [...]
 The hardware on the 24HD is different
 Blame work, which bought me the wrong kind of hardware.

Oh, sorry, I really did not mean to blame anything or anybody, sorry 
if my email sounded like that, it was not my intention.

 Seriously though, support for the modeswitches was rushed in for GNOME
 3.4 and and I4 was all I had with a modeswitch.
 [...]
 gnome-settings-daemon's modeswitch code was only ever tested on an I4,
 by me at least. It's probably wrong for anything else.

Actually not, it probably works well on the vast majority of the 
tablets we support in libwacom, the only one I could find with 
separate mode-switches is the 24HD.

And I realised the problem only once I designed the 24HD layout, and 
just got an email yesterday from someone asking about the odd behavior 
on an 24HD, so it's not like it was obvious from the beginning (at 
least for me).

What I am after is really a way to fix this, without introducing too 
many ugly hacks in gnome-settings-daemon... Thus my question about 
using the API in libwacom to detect the different use cases.

I don't have a 24HD, but for testing I plan on tweaking the I5 tablet 
(the one I have here) definition to use regular buttons as different 
mode switches, after all, the whole concept of modes and switches is 
purely logical. Well, if that works, that would be a cheap alternative 
for testing the code (once it's done) :-)

Cheers,
Olivier.

--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: Mode-switches and libwacom API

2012-12-13 Thread Olivier Fourdan
Olivier Fourdan said the following on 12/13/2012 01:26 PM:
 [...]

 What I am after is really a way to fix this, without introducing too
 many ugly hacks in gnome-settings-daemon... Thus my question about
 using the API in libwacom to detect the different use cases.

Well, it proved easier than I thought, I posted a proposed patch using 
the logic I described initially in GNOME bug 690157

https://bugzilla.gnome.org/show_bug.cgi?id=690157

 I don't have a 24HD, but for testing I plan on tweaking the I5 tablet
 (the one I have here) definition to use regular buttons as different
 mode switches, after all, the whole concept of modes and switches is
 purely logical. Well, if that works, that would be a cheap alternative
 for testing the code (once it's done) :-)

Tested using this method above, works a charm.

Cheers,
Olivier.

-- 
əɔıʌəp əɯos ɥʇıʍ əɹəɥʍəɯos ɯoɹɟ ʇuəs


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel