From 106afb674e04d2ca9ad51090bd5ace2cdb007bba Mon Sep 17 00:00:00 2001 From: speedie Date: Sat, 15 Jul 2023 17:18:20 +0200 Subject: [PATCH] Improve documentation for mouse and key binds --- docs/docs.md | 74 ++++++++++++++++---- spmenu.1 | 190 +++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 238 insertions(+), 26 deletions(-) diff --git a/docs/docs.md b/docs/docs.md index dfbdf2a..bf56a8d 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -580,16 +580,6 @@ press Ctrl+r to enable regex matching. Now typing in `[0-9]` will return the `1 Apple` entry, but not the `One Apple` entry. Of course, more advanced regex can be used as well. -## Keybinds - -You can set keybinds through the config file. A default config file is available -after installing spmenu. This configuration file has identical keybindings to the -default hardcoded keybinds. - -By default, the configuration file will ignore all hardcoded keybindings to -prevent keybind conflicts, but if you do not like this behavior you can -simply set `ignoreglobalkeys = 0`. - ## Modes There are two modes. Normal mode and Insert mode. These modes are of @@ -775,10 +765,68 @@ into multiple segments. Note that spmenu also has a `binds.conf` configuration file, which isn't used very much. This file is documented well [here](https://spmenu.speedie.site/binds.conf+documentation). -## Default keybinds +## Mouse -These are the default keybinds. You can generate these yourself from a -`keybinds.h` using `scripts/spmenu_make`. +spmenu supports mouse clicks. The following parts can be clicked on: + +- `ClickWindow` + - Clicking on the spmenu window +- `ClickPrompt` + - Clicking on the prompt +- `ClickInput` + - Clicking on the input +- `ClickLArrow` + - Clicking on the left arrow +- `ClickRArrow` + - Clicking on the right arrow +- `ClickItem` + - Clicking on the item area +- `ClickSelItem` + - Clicking on an item, function here doesn't matter, it will always be selected +- `ClickImage` + - Clicking on an image +- `ClickNumber` + - Clicking on the match count indicator +- `ClickCaps` + - Clicking on the caps lock indicator +- `ClickMode` + - Clicking on the mode indicator +- `None` + - Any click + +You can set mouse binds through the config file. A default config file is available +after installing spmenu. This configuration file has identical keybinds to the +default hardcoded keybinds. + +By default, the configuration file will ignore all hardcoded mouse binds to +prevent conflicts, but if you do not like this behavior you can +simply set `ignoreglobalmouse = 0`. + + +These are the default mouse binds. Mode does not apply for mouse binds. + +| Click | Button | Function | Argument | +| :----------------- | :----------------- | :----------------- | :----------------- | +| ClickInput | Left Click | clear | 0 | +| ClickPrompt | Left Click | clear | 0 | +| ClickMode | Left Click | switchmode | 0 | +| ClickNumber | Left Click | viewhist | 0 | +| ClickSelItem | Left Click | Outputs the item | 0 | +| None | Scroll Up | moveprev | 0 | +| None | Scroll Down | movenext | 0 | + + +## Keybinds + +You can set keybinds through the config file. A default config file is available +after installing spmenu. This configuration file has identical keybinds to the +default hardcoded keybinds. + +By default, the configuration file will ignore all hardcoded keybinds to +prevent keybind conflicts, but if you do not like this behavior you can +simply set `ignoreglobalkeys = 0`. + +These are the default keybinds. | Mode | Modifier | Key | Function | Argument | | :----------------- | :----------------- | :----------------- | :----------------- | :----------------- | diff --git a/spmenu.1 b/spmenu.1 index 30bb1af..626a39a 100644 --- a/spmenu.1 +++ b/spmenu.1 @@ -613,16 +613,6 @@ matching. Now typing in \f[V][0-9]\f[R] will return the \f[V]1 Apple\f[R] entry, but not the \f[V]One Apple\f[R] entry. Of course, more advanced regex can be used as well. -.SS Keybinds -.PP -You can set keybinds through the config file. -A default config file is available after installing spmenu. -This configuration file has identical keybindings to the default -hardcoded keybinds. -.PP -By default, the configuration file will ignore all hardcoded keybindings -to prevent keybind conflicts, but if you do not like this behavior you -can simply set \f[V]ignoreglobalkeys = 0\f[R]. .SS Modes .PP There are two modes. @@ -833,11 +823,185 @@ Note that spmenu also has a \f[V]binds.conf\f[R] configuration file, which isn\[cq]t used very much. This file is documented well here (https://spmenu.speedie.site/binds.conf+documentation). -.SS Default keybinds +.SS Mouse +.PP +spmenu supports mouse clicks. +The following parts can be clicked on: +.IP \[bu] 2 +\f[V]ClickWindow\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the spmenu window +.RE +.IP \[bu] 2 +\f[V]ClickPrompt\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the prompt +.RE +.IP \[bu] 2 +\f[V]ClickInput\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the input +.RE +.IP \[bu] 2 +\f[V]ClickLArrow\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the left arrow +.RE +.IP \[bu] 2 +\f[V]ClickRArrow\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the right arrow +.RE +.IP \[bu] 2 +\f[V]ClickItem\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the item area +.RE +.IP \[bu] 2 +\f[V]ClickSelItem\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on an item, function here doesn\[cq]t matter, it will always be +selected +.RE +.IP \[bu] 2 +\f[V]ClickImage\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on an image +.RE +.IP \[bu] 2 +\f[V]ClickNumber\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the match count indicator +.RE +.IP \[bu] 2 +\f[V]ClickCaps\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the caps lock indicator +.RE +.IP \[bu] 2 +\f[V]ClickMode\f[R] +.RS 2 +.IP \[bu] 2 +Clicking on the mode indicator +.RE +.IP \[bu] 2 +\f[V]None\f[R] +.RS 2 +.IP \[bu] 2 +Any click +.RE +.PP +You can set mouse binds through the config file. +A default config file is available after installing spmenu. +This configuration file has identical keybinds to the default hardcoded +keybinds. +.PP +By default, the configuration file will ignore all hardcoded mouse binds +to prevent conflicts, but if you do not like this behavior you can +simply set \f[V]ignoreglobalmouse = 0\f[R]. +.PP +These are the default mouse binds. +Mode does not apply for mouse binds. +.PP +.TS +tab(@); +lw(17.5n) lw(17.5n) lw(17.5n) lw(17.5n). +T{ +Click +T}@T{ +Button +T}@T{ +Function +T}@T{ +Argument +T} +_ +T{ +ClickInput +T}@T{ +Left Click +T}@T{ +clear +T}@T{ +0 +T} +T{ +ClickPrompt +T}@T{ +Left Click +T}@T{ +clear +T}@T{ +0 +T} +T{ +ClickMode +T}@T{ +Left Click +T}@T{ +switchmode +T}@T{ +0 +T} +T{ +ClickNumber +T}@T{ +Left Click +T}@T{ +viewhist +T}@T{ +0 +T} +T{ +ClickSelItem +T}@T{ +Left Click +T}@T{ +Outputs the item +T}@T{ +0 +T} +T{ +None +T}@T{ +Scroll Up +T}@T{ +moveprev +T}@T{ +0 +T} +T{ +None +T}@T{ +Scroll Down +T}@T{ +movenext +T}@T{ +0 +T} +.TE +.SS Keybinds +.PP +You can set keybinds through the config file. +A default config file is available after installing spmenu. +This configuration file has identical keybinds to the default hardcoded +keybinds. +.PP +By default, the configuration file will ignore all hardcoded keybinds to +prevent keybind conflicts, but if you do not like this behavior you can +simply set \f[V]ignoreglobalkeys = 0\f[R]. .PP These are the default keybinds. -You can generate these yourself from a \f[V]keybinds.h\f[R] using -\f[V]scripts/spmenu_make\f[R]. .PP .TS tab(@);