Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/wscons.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ static void
wscons_device_init_pointer_acceleration(struct wscons_device *device,
struct motion_filter *filter);

static int old_value = -1;

static int
udev_input_enable(struct libinput *libinput)
{
Expand Down Expand Up @@ -128,13 +126,13 @@ wscons_process(struct libinput_device *device, struct wscons_event *wsevent)
key = wsevent->value;
if (wsevent->type == WSCONS_EVENT_KEY_UP) {
kstate = LIBINPUT_KEY_STATE_RELEASED;
old_value = -1;
dev->old_value = -1;
} else {
kstate = LIBINPUT_KEY_STATE_PRESSED;
/* ignore auto-repeat */
if (key == old_value)
if (key == dev->old_value)
return;
old_value = key;
dev->old_value = key;
}
keyboard_notify_key(device, time,
wskey_transcode(wscons_device(device)->scanCodeMap, key), kstate);
Expand Down Expand Up @@ -517,6 +515,8 @@ wscons_device_init(struct wscons_device *wscons_device)
{
struct libinput_device *device = &wscons_device->base;

wscons_device->old_value = -1;

if (strncmp(device->devname, "/dev/wsmouse", 12) == 0) {
/* XXX handle tablets and touchpanel */
wscons_device->capability = LIBINPUT_DEVICE_CAP_POINTER;
Expand Down
1 change: 1 addition & 0 deletions src/wscons.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct wscons_device {
struct libinput_device base;
enum libinput_device_capability capability;
struct TransMapRec *scanCodeMap;
int old_value;
struct {
struct libinput_device_config_accel config;
struct motion_filter *filter;
Expand Down