aboutsummaryrefslogtreecommitdiff
path: root/include/input_state.h
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-22 21:03:45 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-22 21:03:45 -0700
commit42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6 (patch)
treea323f619fa2a2254fd642dd5f285019510b28632 /include/input_state.h
parente139de0857a1ba015fa324dcc662a39eca88761b (diff)
mouse tile resize mode done
Diffstat (limited to 'include/input_state.h')
-rw-r--r--include/input_state.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/include/input_state.h b/include/input_state.h
index 3a246e0c..747a3563 100644
--- a/include/input_state.h
+++ b/include/input_state.h
@@ -37,52 +37,34 @@ enum pointer_mode {
M_RESIZING = 1 << 3,
};
+struct pointer_button_state {
+ bool held;
+ // state at the point it was pressed
+ int x, y;
+ swayc_t *view;
+};
+
extern struct pointer_state {
// mouse clicks
- bool l_held : 1;
- bool r_held : 1;
-
- // scroll wheel
- bool s_held : 1;
- bool s_up : 1;
- bool s_down :1;
+ struct pointer_button_state left;
+ struct pointer_button_state right;
+ struct pointer_button_state scroll;
// pointer position
struct mouse_origin{
int x, y;
} origin;
+
+ // change in pointer position
struct {
int x, y;
} delta;
- // view pointer is over
+ // view pointer is currently over
swayc_t *view;
// Pointer mode
int mode;
-
- // OLD
- struct pointer_floating {
- bool drag;
- bool resize;
- } floating;
- struct pointer_tiling {
- bool resize;
- swayc_t *init_view;
- struct wlc_origin lock_pos;
- } tiling;
- struct pointer_lock {
- // Lock movement for certain edges
- bool left;
- bool right;
- bool top;
- bool bottom;
- // Lock movement in certain directions
- bool temp_left;
- bool temp_right;
- bool temp_up;
- bool temp_down;
- } lock;
} pointer_state;
// on button release unset mode depending on the button.
@@ -95,8 +77,6 @@ void pointer_mode_update(void);
// Reset mode on any keypress;
void pointer_mode_reset(void);
-void start_floating(swayc_t *view);
-void reset_floating(swayc_t *view);
void input_init(void);
#endif