Absolute pointing devices
Theo Markettos (89) 919 posts |
What’s the current state of play of pointing devices that give out an absolute X,Y coordinate, rather than relative left/right, up/down movements like mice? AIUI currently RPCEmu uses a ‘mouse hack’ to inject absolute pointing information by intercepting the OS_Mouse SWI – but this sometimes goes wrong. Are there any supported absolute pointing devices already (in standard images)? I’m thinking particularly of devices that emulators could easily support. Or are there any that are easy to add? For example, Synaptics PS/2 trackpads have an absolute mode (datasheet page 22) that might be feasible to implement in an emulator to route in absolute pointing events in a ‘natural’ way. Similarly there are PS/2 touchscreens and RS232 digitizers. Or modern touchscreen controllers often use I2C. On PCs VirtualBox emulates a USB graphics tablet as a means of routing in absolute pointing events, so it looks like they’re approached the problem in a similar way. I think asking for emulation of USB in VRPC or RPCEmu is probably a bit much though, but it could be useful for people who have such hardware. |
Dave Higton (1515) 3526 posts |
I’ve been working on a driver for a specific USB graphics tablet recently. Not helpful in the general sense, of course, and clearly not part of any released image, but it proves the point that it could be done. Assuming that all absolute pointing devices are interfaced via USB, one key difficult area is the HID parser. |
Paul Reuvers (507) 6 posts |
Hi Dave, I might be able to help you out. As you probably known, the USBHID module already contains a HID parser. I wrote that module about 10 years ago and I’m currently working on an update. For now, I’ve implemented it as a simple mouse emulation, but if it is to be done properly, a separate Touch or Gesture module would be the right way of doing this, similar to the Joystick module in RISC OS. |
Jeffrey Lee (213) 6048 posts |
Theo: USBDriver has recently gained “improved” support for pointing devices which report absolute coordinates (i.e. it now actually treats it as absolute data rather than trying to treat it as relative data). There are a few compatibility issues (possibly due to bugs in the code, possibly due to devices using different protocols), but it should be working well enough for any USB-supporting emulator to use (QEMU?). It scales the coordinates so that they cover the full screen, and reports them to the OS using the ‘Abso’ mode of PointerV, which is supported by all versions of RISC OS 5. RISC OS Select also has its own method of dealing with absolute pointing devices (based around PointerV 4 used by their OSPointer module). I’m not sure what the best approach would be for other OS versions (read back the pointer position from the OS and generate deltas manually?) For the Synaptics trackpads, the datasheet explains how a driver can detect if a given PS/2 device is a Synaptics device or not (page 41), so I see no reason why an enterprising individual couldn’t add support for it to PS2Driver. Since the device starts off in relative mode, emulators wouldn’t have to care whether the OS supports absolute mode or not. |