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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NAME := buckle
SRC := main.c
VERSION := 1.5.1

PATH_AUDIO ?= "./wav"
PATH_AUDIO ?= $(shell realpath ./wav)

CFLAGS ?= -O3 -g
LDFLAGS ?= -g
Expand Down
12 changes: 12 additions & 0 deletions scan-libinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ static void handle_key(struct libinput_event *ev)
play(key, state == LIBINPUT_KEY_STATE_PRESSED);
}

static void handle_click(struct libinput_event *ev)
{
struct libinput_event_pointer *k = libinput_event_get_pointer_event(ev);
enum libinput_button_state state = libinput_event_pointer_get_button_state(k);
uint32_t key = 0xff;

play(key, state == LIBINPUT_BUTTON_STATE_PRESSED);
}

static void handle_events(struct libinput *li)
{
struct libinput_event *ev;
Expand All @@ -55,6 +64,9 @@ static void handle_events(struct libinput *li)
case LIBINPUT_EVENT_KEYBOARD_KEY:
handle_key(ev);
break;
case LIBINPUT_EVENT_POINTER_BUTTON:
handle_click(ev);
break;
default:
break;
}
Expand Down