-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Pekka Sarnila wrote: | | | Joshua Wise wrote: | |> |> Windows feeds us what looks like eight axes: X, Y, Z, Rx, Ry, Rz, |> rglSlider[0], and rglSlider[1]. We map those all right onto X-Plane |> axes. In terms of buttons, windows feeds us four possible POV hats, |> which give us a value ranging from 0 to 7. We map those onto buttons |> manually. Windows then feeds us *actual* buttons, which we map right |> onto buttons. | Ok. I start to work for doing it the same in Linux. Okay. So now there will be a different event that the kernel sends us for a PoV hat, right?
| How about wheels. In USB HID level wheel can be implemented in many | ways. The official HID wheel is a 'rolling over axes'. In HID level it | can be done also as relative axis (giving -1, 0, +1), or it can be given | as two one shot buttons. If it was me implementing this, I'd say to define a seperate event that can be thrown to the user - WHEEL_EVENT_UP, WHEEL_EVENT_DOWN, etc.
| Then there are rogue wheels: My Logitech stick | reports wheel HID Usage-Page: vendor specific ff00, Usage: 2. There are | three ways to get it right: hard code it to Linux driver; allow a vendor | specific driver to be inserted into driver stack; add to Linux driver | support for management program, that can be used to map in some of the | preprogrammed way to a known Usage Page. Match based on vendor ID/device ID, then hardcode the event to correspond to the correct wheel event.
| In reality Logitech wheel works: | | one four bit value: | a notch forward: 1 folowed by 0 | a notch backward: 0xf folowed by 0 Well, that is just a signed 4-bit value: a notch forward is +1, a notch backwards is -1.
| I guess in Windows the legacy driver translates in something general. I guess.
| So are there in Windows X-plane code any mappings other them the ones | you mentioned that berhaps are used for wheels (or any other form of | controls)? My Logitech works in windows X-plane (in user lavel) as it | would be two buttons: a notch is interreted as momentary press of a | button. Is this mapping done in Windows or in X-plane? In Windows. - BUT - that is *not* the right behavior for Linux! Just because Windows is broken, that does not mean that Linux should be equally broken! I can write soem translations in Linux X-Plane if need be.
| It is also | possible that the windows X-plane internally sees this as a hat switch | (with only two values actually used). Then no third type mapping in | X-plane would be needed. Possibly, but I would be very surprised.
| I agree with. I think the best way is to do it as similarily as possible | with windows (not that I'm any big windows fan) for simple reason that | that would be the best for all who want to port games from windows to | Linux. If the way that Windows does it is broken, we should not do it that way, and it is as simple as that. It is not difficult to write a bit of compatibility code. They would have to write a DirectInput compatibility layer anyway (or some gluecode from Linux input -> their application) - they can write the extra five lines to translate wheels to button presses.
| All in all there are really essentially only three main types of | controls: axis, buttons (on/off), limited multivalue items (like hat | switch or radio knob). The user program should always get values as one | of the three main type, plus indication of the sub type to guide the | usage of the value. That makes sense. Let's do it like that, unless someone on linux-usb-devel has an objection.
| There was a mailing list six years ago. I don't thing it's active now. | Any way It was run by the person who is still respossible of the HID | input driver. I'm trying to contact him, but it seems he's not active | either. We'll see. Okay. I'm cc:'ing to linux-usb-devel.
| So when functioning properly X-plane will e.g in case of a trim keep | turning the trim while the button is down? I believe so.
| Some devices have hardware autorepeat, some have it in their windows | driver, some do not have it at all. I think for those that do it in | windows driver, there should be Linux equivalent available. Autorepeat for the time being should be application level. Once you lose data (i.e., button stays pressed vs. button got released and pressed again), there is no way to recover it.
| Pekka joshua -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFBrY52Pn9tWOqA4LMRAtUEAJ0WymPP/VIr53iKPi9UwTbcU5uudgCfeCZK WYwcm+a7KLELFdKXnJLz2fg= =L/5k -----END PGP SIGNATURE-----
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel