Ctrl-Button1 now has a relative drag using the XC_fleur cursor.
XC_fleur is normally the cursor for "size all" action, which has 4
arrows pointing to 4 directions.
Co-authored-by: NRK <nrk@disroot.org>
Before all the predated commands where kept in an array and their
indexes were used in bindings. This meant that users couldn't add their
own functions from the config file. Now key/mouse bindings have been
changed to to store the function ptr (wrapped in a cmd_t struct to also
store the mode) directly instead.
General cleanup done in this commit:
Defined `MODE_ALL` instead of using magic number.
For example, suppose one had bindings like:
{ 0, XK_q, g_quit, None },
{ ShitMask, XK_q, {quit_err}, None }
{ ControlMask, XK_q, {quit_err, .mode=MODE_IMAGE}, None }
The existing binding `q` has been left unchanged and is defined the same
way. However, the new hypothetical binding `Shift-q` can be used to call
the custom function quit_err in any mode (default). `Ctrl-q` on the
other hand will be called only on image mode.
Closes#50
* remove duplicate comment
* remove empty tabs and blank lines
* move macros and globals ontop
* comment to seprate function implementation
* fix alignment
* switch to *argv[] similar to other suckless code
* kill all empty last lines
* append comment to endif
* reuse existing ARRLEN macro
* comment fall through
* use while (true) everywhere
Co-authored-by: NRK <nrk@disroot.org>
Currently when running the key-handler the statusbar shows a
"Running key-handler..." message, but there's no indication of the prefix key
being pressed.
There's a slight functional benefit of this patch in the sense
that users can visually tell if the key-handler is listening on input or if the
key-handler has been aborted or not.
* add -0 for outputting null-terminated list
this doesn't add much, if any, additional complexity to the codebase and
can be quite handy for scripting purposes.
Closes: https://github.com/nsxiv/nsxiv/issues/67
* Fix typo
Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
None of the mouse mappings uses a keyboard modifier, making it possible to
access the most basic features by only using the mouse.
Next/previous image with left button depending on cursor position, middle
button for dragging, right button for switching to thumnail mode and wheel for
zooming.
Users can keep the old behaviour by simply not adapting the changes to the
buttons array in config.def.h to their config.h file.
- Functions warn() and die() replaced by GNU-like error(3) function
- Register cleanup() with atexit(3)
- Functions called by cleanup() are marked with CLEANUP and are not allowed to
call exit(3)
- Only load the thumbnails that are currently visible in the window
- Unload thumbnails that are leaving the visible area
- Much less memory needed, but scrolling is now slower
- This also unintentionally fixes issue #86