On Fri, Dec 21, 2018 at 8:16 AM Billy Laws <blaws05@xxxxxxxxx> wrote: > > > > On 21 December 2018 09:56:10 GMT, Benjamin Tissoires <benjamin.tissoires@xxxxxxxxx> wrote: > >Hi Billy, > > > >On Tue, Dec 18, 2018 at 11:16 AM Billy Laws <blaws05@xxxxxxxxx> wrote: > >> > >> Hi, > >> I'm looking into making a driver for the Nintendo switches joycon, > >they are two separate controllers that can be used together or > >separately but most of the time they are used together as one > >controller. > >> Each of them is presented as a separate Bluetooth hid device so I'm > >not sure the best way to represent them to user space. Should I have a > >new input device for each separate joycon or create a new input device > >for every pair of l+r joycon? > > > >I'd say if they are 2 distincts bluetooth devices, it makes sense to > >have them separated. However, in the same way we have touch panels > >that are doing pen and touch and that are exported as 2 separate > >device nodes, you should be able to provide the info to the user space > >that those 2 devices are supposed to be used together. > >For pen/touch devices, userspace (udev) relies on the physical path > >and assign LIBINPUT_DEVICE_GROUP to group those 2 devices altogether. > > > >So I think if you provide a way from the serial to be able to match > >those 2, user space should be OK. > > > >However, please note that I am not in the SDL community (I am more a > >regular input devices developer) so their advice might differ. > > > Also, what about programs that access the controller directly without libinput, i guess they would need to be fixed? > How would I tell userspace which one is left and which one is right? Do the left and the right joycon have a different product id? Ideally applications use vendor and product id. Worst case you can put Left / Right in the device string... Thanks, Roderick