mirror of
https://github.com/swaywm/sway.git
synced 2025-11-01 22:58:41 -04:00
input state, find_container_in_direction
This commit is contained in:
parent
470b4dfbae
commit
5ff0619ca1
10 changed files with 211 additions and 203 deletions
49
include/input_state.h
Normal file
49
include/input_state.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef _SWAY_KEY_STATE_H
|
||||
#define _SWAY_KEY_STATE_H
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "container.h"
|
||||
|
||||
/* Keyboard state */
|
||||
|
||||
typedef uint32_t keycode;
|
||||
|
||||
// returns true if key has been pressed, otherwise false
|
||||
bool check_key(keycode key);
|
||||
|
||||
// sets a key as pressed
|
||||
void press_key(keycode key);
|
||||
|
||||
// unsets a key as pressed
|
||||
void release_key(keycode key);
|
||||
|
||||
/* Pointer state */
|
||||
|
||||
enum pointer_values {
|
||||
M_LEFT_CLICK = 272,
|
||||
M_RIGHT_CLICK = 273,
|
||||
M_SCROLL_CLICK = 274,
|
||||
M_SCROLL_UP = 275,
|
||||
M_SCROLL_DOWN = 276,
|
||||
};
|
||||
|
||||
extern struct pointer_state {
|
||||
bool l_held;
|
||||
bool r_held;
|
||||
struct pointer_floating {
|
||||
bool drag;
|
||||
bool resize;
|
||||
} floating;
|
||||
struct pointer_lock {
|
||||
bool left;
|
||||
bool right;
|
||||
bool top;
|
||||
bool bottom;
|
||||
} lock;
|
||||
} pointer_state;
|
||||
|
||||
void start_floating(swayc_t *view);
|
||||
void reset_floating(swayc_t *view);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue