mouse: add support for drag mouse event

This commit is contained in:
ARDiDo 2022-01-06 18:30:17 -05:00 committed by Johan Malm
parent ab07b68d7e
commit 5935a78fb4
6 changed files with 58 additions and 31 deletions

View file

@ -49,6 +49,8 @@ mousebind_event_from_str(const char *str)
return MOUSE_ACTION_PRESS;
} else if (!strcasecmp(str, "release")) {
return MOUSE_ACTION_RELEASE;
} else if (!strcasecmp(str, "drag")) {
return MOUSE_ACTION_DRAG;
}
wlr_log(WLR_ERROR, "unknown mouse action (%s)", str);
return MOUSE_ACTION_NONE;

View file

@ -520,23 +520,23 @@ load_default_key_bindings(void)
static struct {
const char *context, *button, *event, *action, *command;
} mouse_combos[] = {
{ "Left", "Left", "Press", "Resize", NULL},
{ "Top", "Left", "Press", "Resize", NULL},
{ "Bottom", "Left", "Press", "Resize", NULL},
{ "Right", "Left", "Press", "Resize", NULL},
{ "TLCorner", "Left", "Press", "Resize", NULL},
{ "TRCorner", "Left", "Press", "Resize", NULL},
{ "BRCorner", "Left", "Press", "Resize", NULL},
{ "BLCorner", "Left", "Press", "Resize", NULL},
{ "Frame", "A-Left", "Press", "Focus", NULL},
{ "Frame", "A-Left", "Press", "Raise", NULL},
{ "Frame", "A-Left", "Press", "Move", NULL},
{ "Frame", "A-Right", "Press", "Focus", NULL},
{ "Frame", "A-Right", "Press", "Raise", NULL},
{ "Frame", "A-Right", "Press", "Resize", NULL},
{ "Titlebar", "Left", "Press", "Focus", NULL},
{ "Titlebar", "Left", "Press", "Raise", NULL},
{ "TitleBar", "Left", "Press", "Move", NULL },
{ "Left", "Left", "Drag", "Resize", NULL},
{ "Top", "Left", "Drag", "Resize", NULL},
{ "Bottom", "Left", "Drag", "Resize", NULL},
{ "Right", "Left", "Drag", "Resize", NULL},
{ "TLCorner", "Left", "Drag", "Resize", NULL},
{ "TRCorner", "Left", "Drag", "Resize", NULL},
{ "BRCorner", "Left", "Drag", "Resize", NULL},
{ "BLCorner", "Left", "Drag", "Resize", NULL},
{ "Frame", "A-Left", "Drag", "Focus", NULL},
{ "Frame", "A-Left", "Drag", "Raise", NULL},
{ "Frame", "A-Left", "Drag", "Move", NULL},
{ "Frame", "A-Right", "Drag", "Focus", NULL},
{ "Frame", "A-Right", "Drag", "Raise", NULL},
{ "Frame", "A-Right", "Drag", "Resize", NULL},
{ "Titlebar", "Left", "Drag", "Focus", NULL},
{ "Titlebar", "Left", "Drag", "Raise", NULL},
{ "TitleBar", "Left", "Drag", "Move", NULL },
{ "TitleBar", "Left", "DoubleClick", "ToggleMaximize", NULL },
{ "Close", "Left", "Click", "Close", NULL },
{ "Iconify", "Left", "Click", "Iconify", NULL},