foot/input.h
Pranjal Kole 0da19a81bc replace gettimeofday with clock_gettime
POSIX.1-2008 has marked gettimeofday(2) as obsolete, recommending the
use of clock_gettime(2) instead.

CLOCK_MONOTONIC has been used instead of CLOCK_REALTIME because it is
unaffected by manual changes in the system clock. This makes it better
for our purposes, namely, measuring the difference between two points in
time.

tv_sec has been casted to long in most places since POSIX does not
define the actual type of time_t.
2022-01-15 21:35:45 +05:30

36 lines
1.1 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <stdint.h>
#include <wayland-client.h>
#include "wayland.h"
#include "misc.h"
/*
* Custom defines for mouse wheel left/right buttons.
*
* Libinput does not define these. On Wayland, all scroll events (both
* vertical and horizontal) are reported not as buttons, as axis
* events.
*
* Libinput _does_ define BTN_BACK and BTN_FORWARD, which is
* what we use for vertical scroll events. But for horizontal scroll
* events, there arent any pre-defined mouse buttons.
*
* Mouse buttons are in the range 0x110 - 0x11f, with joystick defines
* starting at 0x120.
*/
#define BTN_WHEEL_LEFT 0x11e
#define BTN_WHEEL_RIGHT 0x11f
extern const struct wl_keyboard_listener keyboard_listener;
extern const struct wl_pointer_listener pointer_listener;
void input_repeat(struct seat *seat, uint32_t key);
void get_current_modifiers(const struct seat *seat,
xkb_mod_mask_t *effective,
xkb_mod_mask_t *consumed,
uint32_t key);
const char *xcursor_for_csd_border(struct terminal *term, int x, int y);