blackhole89 / notekit

A GTK3 hierarchical markdown notetaking application with tablet support.
GNU General Public License v3.0
1.44k stars 61 forks source link

[enhancement] Keyboard shortcut for eraser, brush size, pen, colors, etc #131

Open omsfah opened 2 years ago

omsfah commented 2 years ago

I cant seem to find any keystrokes to change between tools, as I'm using a drawing tablet i would love to be able to change settings with keyboard input. Also, if doable, i know many drawing tablets have a built in eraser function, if possible to map these so notekit automatically changes would be great.

blackhole89 commented 2 years ago

I cant seem to find any keystrokes to change between tools, as I'm using a drawing tablet i would love to be able to change settings with keyboard input.

My reasoning on this so far was that since you basically use pointer interaction for all tools apart from text entry, there is no problem in only making tools switchable by pointer click (since the most natural interaction while using a pen or mouse is to click something, not go back to your keyboard and press a key). Is this wrong? What sort of interaction are you specifically envisioning?

Also, if doable, i know many drawing tablets have a built in eraser function, if possible to map these so notekit automatically changes would be great.

I've seen two ways of implementing tablet erasers. One of them has the pen register as a different device while it's erasing; in that case, Notekit should at least remember that it's an eraser after you've set it to eraser once, as the current tool setting is maintained on a per-device basis. The other one is sending the eraser status as a mouse button or modifier key. (Probably common when erasing is implemented by a physical button on the pen or similar.) In that situation, we currently don't have any special handling, and I think it would be good to add something, but we need to understand if there is some form of standard (what button/key code is associated with erasing) or if we need to add a config setting to accommodate different setups.

sp1ritCS commented 2 years ago

The other one is sending the eraser status as a mouse button or modifier key. (Probably common when erasing is implemented by a physical button on the pen or similar.) In that situation, we currently don't have any special handling, and I think it would be good to add something, but we need to understand if there is some form of standard (what button/key code is associated with erasing) or if we need to add a config setting to accommodate different setups.

GDK3 already has Gdk.DeviceToolType that you can get from gdk_device_tool_get_tool_type() (with the device tool from gdk_event_get_device_tool()). It should handle almost any wacom digitizer just fine (no idea about other brands).

I sent you a patch that uses it to set the proper tool type for each tool initially. Got probably lost in the depths of the chatroom 🥴

omsfah commented 2 years ago

I was not aware of notekits capabilities to separate devices, I haven't thought of the option to manually choose eraser first. But that works excellent! I would still enjoy keyboard shortcuts if possible, too quickly change between colors/ brush dimmensions while taking notes (For context, my drawing board has buttons that can emulate keyboard input)

sp1ritCS commented 2 years ago

For context, my drawing board has buttons that can emulate keyboard input

Out of personal interest, what software to you use to map these? My digitizer also has one pad with a few buttons that stay unused on Linux, as there isn't any vendor software that reacts to them. I was always wondering if I could use them to execute some action.

omsfah commented 2 years ago

I'm lucky enough that my drawing board comes shipped with software for this exact purpose, but I assume something like evdev should be able to detect and emulate keys thereafter, previously on Windows i used powertoys for this exact purpose. Might be worth checking out the wacom linux forums? On a side note, the xencelabs quickkeys are a great little macropad, which you can customise through their driver. Best of luck!

sp1ritCS commented 2 years ago

but I assume something like evdev should be able to detect and emulate keys thereafter

yes, I'm aware I can get the pad buttons events via evdev. I was more looking if there some kind of software specifically made for it. The Xencelabs driver seems to be licensed under the LGPL, but I'm not able to find any sources. Do they just provide them to customers?

omsfah commented 2 years ago

I'm not sure, i know they have a presence on reddit subreddit - redittor/ company representative They have also previously shared their ARCH driver over G-disk to make it faster accessible for users, so they seem like a company that could maybe send you the info you need just to be nice. If you where looking for the driver it's located here

sp1ritCS commented 2 years ago

If you where looking for the driver it's located here

yes, I'm aware. The rpm package they provide as part of the driver archive has it's license field set to LGPL, but I suspect that this is incorrectly labeled as free software when it isn't.

omsfah commented 2 years ago

Ahh, that might be. I guess a few companies get good representation based on the fact that few bother to check?

Speaking of freeware, if one wishes to donate some dollars for enjoying notekit, is there a "beerware" or similar option?

sp1ritCS commented 2 years ago

I guess a few companies get good representation based on the fact that few bother to check?

hanlon's razer. I'd prefer to think it's just someone that doesn't have much experience in packaging things and just added LGPL there, as the bundled QT libs carry an LGPL license, into the license field; and it propagated to other packages (i.e. the one in the AUR) from there.

Speaking of freeware, if one wishes to donate some dollars for enjoying notekit, is there a "beerware" or similar option?

Nothing official as far as I'm aware of. Could try looking if @blackhole89 has PayPal set up for his email he uses to commit.