phijor / ctroller

Use your 3DS as a gamepad on linux
GNU General Public License v3.0
39 stars 12 forks source link

Mouse is absolute, and therefore pretty useless, maybe use EV_REL instead? #7

Open hacker1024 opened 6 years ago

hacker1024 commented 6 years ago

From the linux input documentation:

In addition to EV_KEY, there are two more basic event types: EV_REL and EV_ABS. They are used for relative and absolute values supplied by the device. A relative value may be for example a mouse movement in the X axis. The mouse reports it as a relative difference from the last position, because it doesn't have any absolute coordinate system to work in. Absolute events are namely for joysticks and digitizers - devices that do work in an absolute coordinate systems.

Having the device report EV_REL buttons is as simple as with EV_KEY, simply set the corresponding bits and call the

input_report_rel(struct input_dev *dev, int code, int value)

function. Events are generated only for nonzero value.