提交 89bdd0c6 编写于 作者: D David Herrmann 提交者: Jiri Kosina

HID: wiimote: fix nunchuck button parser

The buttons of the Wii Remote Nunchuck extension are actually active low.
Fix the parser to forward the inverted values. The comment in the function
always said "0 == pressed" but the implementation was wrong from the
beginning.

Cc: stable@vger.kernel.org
Reported-by: NVictor Quicksilver <victor.quicksilver@gmail.com>
Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 30b6b7d8
......@@ -403,14 +403,14 @@ static void handler_nunchuck(struct wiimote_ext *ext, const __u8 *payload)
if (ext->motionp) {
input_report_key(ext->input,
wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x04));
wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x04));
input_report_key(ext->input,
wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x08));
wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x08));
} else {
input_report_key(ext->input,
wiiext_keymap[WIIEXT_KEY_Z], !!(payload[5] & 0x01));
wiiext_keymap[WIIEXT_KEY_Z], !(payload[5] & 0x01));
input_report_key(ext->input,
wiiext_keymap[WIIEXT_KEY_C], !!(payload[5] & 0x02));
wiiext_keymap[WIIEXT_KEY_C], !(payload[5] & 0x02));
}
input_sync(ext->input);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册