Created
August 13, 2012 21:26
-
-
Save Tasssadar/3344210 to your computer and use it in GitHub Desktop.
Fix for kernel joystick bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c | |
| index 26043cc..11f24b4 100644 | |
| --- a/drivers/input/joydev.c | |
| +++ b/drivers/input/joydev.c | |
| @@ -318,9 +318,14 @@ static int joydev_generate_startup_event(struct joydev_client *client, | |
| event->value = !!test_bit(joydev->keypam[event->number], | |
| input->key); | |
| } else { | |
| + int evnum = client->startup - joydev->nkey; | |
| + int val = input_abs_get_val(input, joydev->abspam[evnum]); | |
| + | |
| + joydev->abs[evnum] = joydev_correct(val, &joydev->corr[evnum]); | |
| + | |
| event->type = JS_EVENT_AXIS | JS_EVENT_INIT; | |
| - event->number = client->startup - joydev->nkey; | |
| - event->value = joydev->abs[event->number]; | |
| + event->number = evnum; | |
| + event->value = joydev->abs[evnum]; | |
| } | |
| client->startup++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment