Commit 0da2298f authored by John Neffenger's avatar John Neffenger

Get only two bytes for the Linux input event type

The Linux input event type is defined in <linux/input.h> as an unsigned
short, two bytes in size, but the constructor for LinuxEventBuffer reads
four bytes for the type by calling the method getInt(int). Change this
method call to getShort(int).

Fixes #3
parent 7619c213
......@@ -90,7 +90,7 @@ class LinuxEventBuffer {
*/
synchronized boolean put(ByteBuffer event) throws
InterruptedException {
boolean isSync = event.getInt(eventStruct.getTypeIndex()) == 0
boolean isSync = event.getShort(eventStruct.getTypeIndex()) == 0
&& event.getInt(eventStruct.getValueIndex()) == 0;
while (bb.limit() - bb.position() < event.limit()) {
// Block if bb is full. This should be the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment