linuxmint / cinnamon-control-center

A collection of configuration plugins used in cinnamon-settings
GNU General Public License v2.0
62 stars 66 forks source link

[tablet] Can't assign <ctrl> , <alt> or <shift> key to a tablet button or stylus button #76

Open Deevad opened 10 years ago

Deevad commented 10 years ago

Hi, it's impossible for the moment to assign ctrl , alt or shift key to a tablet button or stylus.

To reproduce:

  1. Try to configure button of tablet and stylus
  2. Press 'send keystroke' , and press ctrl , alt or shift
  3. Nothing happen.

Expected Probably having the ctrl , alt or shift key working in 'send keystroke' or having choice with a new option ' send modifier keystroke' and have the list of key here with checkboxes, ready to select.

This keys are really important for designer, and artist.

leigh123linux commented 9 years ago

I think this issue is invalid as ctrl , alt and shift are already in use for many other keybindings.

Deevad commented 9 years ago

@leigh123linux : I don't want to bind ctrl , alt or shift to any function. Pls don't comment if you are not owner/user of Wacom/tablet device and don't know the issue.

Tablet owner just need to assign Ctrl, Alt or Shift on the button of a Wacom ( or stylus button, witch is something designed by the driver of the constructor under windows/macOS but not on Linux ). Note : Gnome fixed it after 3.10 , KDE got it. Unity and Cinnamon lag behind ( forking Gnome 3.8 tablet ) . Ctrl can color pick , Shift change brush size, Alt can change behavior of tools. (eg: Krita ).

screenshot from 2015-01-11 19 13 01

leigh123linux commented 9 years ago

@Deevad

With a pissy attitude like that your issue can rot.

zorbama commented 9 years ago

I confirm the issue - Shift, Ctrl and Alt cannot be assigned on their own, only as a combination, a thing which damages the efficiency of the workflow with a tablet. In order to assign these keys to the tablet buttons, I use an extra script that runs at startup. It doesn't interfere with the other button assignments, but it doesn't integrate nicely (i.e. doesn't display button assignment on the help screen), and of course it's not as convenient to configure.

Deevad commented 9 years ago

@zorbama : Thanks for your confirmation. I agree with your descriptions.

Workaround

For those who really need it and can't use Cinnamon/Mint, here is the (big) workaround involving command line, script and other dirty things a normal user shoudn't consider as something normal to setup an hardware ( graphist needs a GUI and focus on making good graphism, not script/code ) :

1) Get tablet Xinput name

First, open a terminal in your apps, and type xinput --list and press enter, you should get an output looking like this:

⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Wacom Intuos3 9x12 stylus                 id=8    [slave  pointer  (2)]
⎜   ↳ Wacom Intuos3 9x12 eraser                 id=12   [slave  pointer  (2)]
⎜   ↳ Wacom Intuos3 9x12 cursor                 id=13   [slave  pointer  (2)]
⎜   ↳ Wacom Intuos3 9x12 pad                    id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Power Button                                id=7    [slave  keyboard (3)]

Note for reference your tablet pad name, mine here is Wacom Intuos3 9x12 pad. Select the name, then with Ctrl+Shift+C copy it.

2) Create a Xsetwacom bash script

Open the file manager (Nemo) , and in the folder of your choice ( I use /home/deevad/Script ) create a new empty file with right-click , "create a new document">"Empty document". Name it tablet.sh , then open it with a text-editor. Inside it write a script like this with your tablet name:

#! /bin/bash
# wacom tablet button script
xsetwacom set "Wacom Intuos3 9x12 pad" Button 1 "key Shift_L"
xsetwacom set "Wacom Intuos3 9x12 pad" Button 2 "key Control_L"

This example script will map Shift to the button 1 (resize brush in Krita) , and Control to the button 2 ( pick color on Krita/Gimp/Mypaint) of the tablet. ( Note: other key name works like key ctrl ,key Control, key shift. ) The key names use a standard, and for assigning other key I paster here a list of common names http://pastebin.com/aXGDkJTU

If you want to assign a modifier ( eg. Ctrl ) on the stylus button, it's also possible:

xsetwacom set "Wacom Intuos3 9x12 stylus" Button 2 "key ctrl"

When your script is finished you can save it. In the file-manager ; right-click on it again > Properties > Permissions > and in front of Execute check the box for 'Allow executing file as a program'.

3) Run it, create a start-up

You can double click and run the script. Your key on tablet will be mapped. But all setup of the button will not last a reboot. That's why we made a script to execute it at each start-up. Go now on 'System Settings', then 'Start-up application' , press the 'Add' button , give the form a name of your choice, for the command pick your script via the 'Browse' button, and comment what you want about it.

Note : you can also create a Menu entry with it , sometime ( after suspend , or a long period of lock ) the setting get reset, with a shortcut on panel you can restore everything.

End notes:

Xsetwacom can do all with your tablet ; for more option on your script ; check http://linuxwacom.sourceforge.net/wiki/index.php/Xsetwacom

Good luck !

tylerecouture commented 9 years ago

+1

This would definitely be nice to have. Thanks!

bekroogle commented 9 years ago

@leigh123linux

I agree that Deevad's tone in his response may not engender cooperation. Though please keep in mind that there are a great many of us out here who are really friendly and would very much benefit from this issue being solved. :pray:

Deevad commented 9 years ago

Sorry if the tone of my answer was misinterpreted. I am friendly and just wanted to contribute here and write a useful bug-report for Wacom tablets but I see it was a mistake.

@leigh123linux probably took a glance at the bug report 4 month after being posted, and thought it was about the Keyboard key-binding shortcut panel. I don't blame his/her error. I just didn't wanted my bug-report to be invalided by error or managed by non Wacom user. So, seeing he/she was off-topic I just pleased him/her to not comment if he/she don't own a Wacom tablet and not understand the issue. ( owning and using one is a requirement to understand usage and do development about Wacom anyway ). He/She insulted my attitude being 'pissy' and treats this bug report to 'rot'... I don't understand how his/her attitude helped this topic at all... Btw, not first time I'm reading inappropriate attitude from this user on Github.

aniruddhahar commented 8 years ago

Can confirm in Cinnamon 3.0 in Linux Mint 18. Assigning ctrl/alt/shift as modifiers with xsetwacom doesn't work, nor does it work with the Map Buttons option in System Wacom Tablet Settings.

AinaSG commented 8 years ago

Same bug with the latest libwacom2 release

Trokenheim commented 7 years ago

This bugs me a lot, since (as @Deevad explained) basic functions as colorpicker or change brush size is dependent on pressing ctrl or shift. I'm grateful for the workaround, but it feels as I need to be a hacker to do that.

Another workaround is of course to just change the keyboard shortcuts, but that is not a very nice workaround really.

Trokenheim commented 7 years ago

This blog also explains how to use the xsetwacom in a nice way: http://ragnarb.com/configuring-wacom-cintiq-13hd-with-ubuntu-14-04/

chrisphyffer commented 7 years ago

I think I got this to work based on a combination of @Trokenheim /ragnarb's suggestion. I am able to map the ctrl button on my wacom intuos 3.

It was a bit weird at first, so you'll need to make a log on what xset wacom button # correspond to what buttons on your tablet.

Keep in mind the following modifiers : "+ctrl" (+) means ctrl press down "-ctrl" (-) means ctrl press up "+shift" "+alt" "+super" Your 'start menu key'

If you wanted to use "CTRL+Z", you would assign the following entry to xsetwacom: "+ctrl z -ctrl"

1.) Open your terminal, type xsetwacom --list devices

2.) If you see your Intuos/graphire/bamboo pad listed, make a note of the ID number.

3.) type xsetwacom --get {MYDEVICEID} Button 1 ^ Note, I found that there is no button 0, so the index starts at 1.

4.) Repeat the above step for buttons 1 to X until you HIT a message Button Number does not exist on the device. If you see the output: "Button +x", that means the button is available for assignment. If you see only a number, it will mean (I think, i'm not a linux programmer here) that the button will have some difficulty being assigned..for some reason.

5.) type xsetwacom --set {MYDEVICEID} Button "key {my key}". For example, to assign CTRL to button #1, do xsetwacom --set {MYDEVICEI} Button "key +ctrl"

6.) ^ repeat this step for buttons 1 - {{button_availability_length}}, and assign random keys to the button to see which button corresponds where. The reason why I suggest this, is because I had thought Button 4 existed on my tablet...instead that button turned out to be button 8..

If you want this script to run at start up, see this issue: https://stackoverflow.com/questions/36782554/xsetwacom-works-fine-but-wont-run-inside-a-bash-script

Thank you @Deevad @Trokenheim for bringing this to the surface and helping me out. I am able to get Krita all set up and blender as well. Very happy.

Your tone was spot on @Deevad . be direct.

Skydancer9 commented 7 years ago

I can also confirm this issue of not being able to assign ctrl , alt or shift key to a tablet button or stylus. I use Wacom Intuos 4. It is possible, however, to do this via xsetwacom command line tool. It would be nice if Cinnamon fully supported Wacom tablets setup (like Gnome does). Of course I can do it manually via terminal, but I prefer not to because it is time consuming (I'd rather be creating art instead).

Also, Wacom Intuos OLED support (LED text beside buttons) would be really nice! It's been in the Linux kernel since v. 3.2.

@Deevad and @phyffer thanks for providing helpful info. On my Manjaro Linux system my tablet keeps changing device IDs so instead of using device ID I have to use the full name of the device, for example: xsetwacom --set "Wacom Intuos4 6x9 Pad pad" Button 13 "key +shift" Otherwise my shell script will stop working sooner or later.

stvnhrtlr commented 7 years ago

Hi guys, I think I found a workaround. I have a MacbookPro + Wacom Intuos Pro, and I needed to assign alt + tab to my stylus, so I can change the size and strength of my pencil in Photoshop (sorry if all the terms are not accurate, I'm French).

SOLUTION : What I did is I assigned "Alt+Ctrl+ù" which in my computer has no impact, and works the same way as "Alt+Ctrl". And it works great !! Bottom line : try a combination of "Alt+Ctrl" + anything that has no shortcut, and it should work fine ;) !

Cheers !

Ozman commented 6 years ago

If you wanted to use "CTRL+Z", you would assign the following entry to xsetwacom: "+ctrl z -ctrl"

I was tearing my hair out wondering why every express button worked except ctrl+z. I would never have guessed to use this combination. Thanks so much. Using KDE5 on PCLOS with Krita 3.3.3 and Intuos Pro Medium.

n1c0saurio commented 4 years ago

Another way is via dconf settings. Navigate to org.cinnamon.settings-daemon.peripherals.wacom, select the tablet pad, then the button you want to modify and write manually the name of the key under custom-action:

Captura de pantalla de 2020-04-07 09-35-03

Even in Control Center the change is reflected correctly:

Captura de pantalla de 2020-04-07 09-34-40

Deevad commented 4 years ago

Just for update, things moved on the Plasma side. I wrote an install guide for Kubuntu 19.10 who has a high-quality tablet support and GUI now out-of-the-box. An option to consider for artist using GNU/Linux systems. The blog-post: https://www.davidrevoy.com/article761/kubuntu-linux-19-10-for-a-digital-painting-workstation-reasons-and-install-guide

chrisphyffer commented 4 years ago

WOW, I was waiting for a GUI to handle the wacom on linux...This is really nice! Thanks!

Now, the functionality to remap wacom keys for different applications would be brutal.

Currently back on windows (unfortunately), I have my pen mapped differently for blender/zbrush/photoshop etc using wacom's tablet software. I wish they had a build for linux as that would solve so many problems - and encourage more of a shift to Linux...maybe one day. thanks again!

Deevad commented 4 years ago

@chrisphyffer Haha, I remember this feature. No, the KDE graphic tablet doesn't have that but it has a Profile Management. This allows totally different shortcut layout and mapping. To switch the profile, three options:

icarter09 commented 4 years ago

@Deevad what's the status of this ticket?

Deevad commented 4 years ago

Hi @icarter09 still valid in Mint 19.x series, still no progress since 2014.

Do you know if recent/upcoming Mint 20 changed the tablet GUI to recent GNOME's one?

mindinsomnia commented 4 years ago

@clefebvre Hey Clem, this issue has flown under the radar for a very long time, about 6 years now. Is it possible we could possibly have this looked at?

The impact of this bug is pretty bad. Most design software associates keystrokes like alt, shift or ctrl with important modifiers for tools.

For example, I do 3D sculpting in Blender, and shift is the modifier used for smoothing out brush strokes, ctrl inverts the effect of the active brush. These modifiers are used almost constantly during sculpting.

Would this bug be difficult to fix?

haplorhine commented 3 years ago

Decent Person: 1 + 1 = 2

Mint Person:

With a pissy attitude like that your issue can rot.

Still doesn't work (Linux Mint 20 Cinnamon) in addition to crashing when plugging in a tablet (https://github.com/linuxmint/cinnamon-control-center/issues/212). Going back to KDE.

Robert42 commented 3 years ago

Decent Person: 1 + 1 = 2

Mint Person:

With a pissy attitude like that your issue can rot.

Still doesn't work (Linux Mint 20 Cinnamon) in addition to crashing when plugging in a tablet (#212). Going back to KDE.

Come on. We are not here to parent each other but to give the developers the feedback they need to make a really great piece of software even better. Many of them are probably doing this in their sparen time.

I use Mint every day for programming and really like it. Fixing this issue would be a great benefit when pursuing the crative part of my hobbies. So no more fighting, please?

stefan123t commented 3 years ago

I wrote a small shell script to come up with the out-of-the-box settings for the wacom tablet:

get_wacom_setup.sh:

#!/bin/bash
# get all current parameters for all devices

echo "#!/bin/bash"
for d in $(xsetwacom --list devices | sed 's/\t/\|/g' | cut -d'|' -f2 | cut -d':' -f2);
do 
   echo
   # echo "# $d";
   echo -n "# ";
   xsetwacom --list devices | grep $d
   for i in $(xsetwacom --list parameters | cut -d'-' -f1);
   do
      xsetwacom -s --get $d $i 2>/dev/null;
   done;
done | tee wacom_setup.sh
chmod +x wacom_setup.sh

You can then modify the wacom_setup.sh script with the keycodes you would like to bind.

Note that the cinnamon-settings wacom in Linux Mint 20.1 does include a way to set keystrokes under Map Buttons.... image

I was able to assign the keystrokes Ctrl+Z to the Button 1 on my tablet and issue it e.g. to send a running tail -f /var/log/dmesg to sleep on my terminal. So this is working, maybe it is just not visible very well as the second / third column in that table is somewhat hidden (no side scroll).

It does indeed lack the nice overview of the KDE Settings which shows the numbering of those buttons on different tablet models. Maybe that is something we could adapt from the KDE base ?

I also looked into adding more complex macros to each of my buttons and found the following two tools:

stefan123t commented 3 years ago

@Deevad I read your posts on using tablets with Linux, thanks for the experience and knowledge contained within and the Krita brushes you offer. Can we use animated brushes in Krita too like in GIMP, e.g. to make dry brush strokes appear more natural?

I believe the current settings dialog is quite useful, at least to me as a starter, though I do not know what the Gnome Settings dialog looks like nowadays. image

Apart from that the Autokey tool does allow per Window title remapping of Hotkeys / Settings, which was requested from @chrisphyffer earlier on this page.

stefan123t commented 3 years ago

@Deevad after re-reading your initial posts I understand now that you would like to set the Key"stroke" to be set to only the Qualifier Ctrl, Alt or Shift as this acts as a qualifier for most of the GIMP, Blender, Krita, etc. tools. Eg. using Shift usually adds to a selection, while using Ctrl usually subtracts from the current selection. While Alt mostly allows to pan or move the current selection. And you are right in the Map Buttons... dialog I can only set a keystroke to a Qualifier PLUS a Keystroke but not to a single Qualifier. Now I get the Idea, maybe it would be good if you specify the settings of your current tablet buttons in order for the developers to understand the need for the recording of single qualifiers too ? I think allowing to input the keysyntax that xsetwacom accepts and that @chrisphyffer described earlier would eventually solve this issue. When recording a key-combination the current code could still be used to generate the keysyntax for that field.

stefan123t commented 3 years ago

An example setting for keys can be seen in David Revoy's screencast:

Pen: Button 1: Left mouse button Button 2: +Ctrl Button 3: Right mouse button

Express keys: Button 1: E Button 2: & Button 3: : Button 4: ; Button 5: Z Button 6: O Button 7: I Button 8: < Button 9: cannot see

So he is trying to use the Button 2 on his pen as a qualifier, but it could be equally well set on some of the express keys, as they are closer to the drawing area compared to the keyboard.

@Deevad I have seen in your screencast from the KDE Settings dialog that it also allows to configure the pressure curve of the Pen

PressureCurve x1 y1 x2 y2 A Bezier curve of third order, composed of two anchor points (0,0 and 100,100) and two user modifiable control points that define the curve's shape. Raise the curve (x1<y1 x2<y2) to "soften" the feel and lower the curve (x1>y1 x2>y2) for a "firmer" feel. Sigmoid shaped curves are permitted (x1>y1 x2<y2 or x1y2). Default: 0 0 100 100, a linear curve; range of 0 to 100 for all four values.

and from your blog posts I read that you are making heavy use of the Tablet Area Mapping in your daily artwork.

Area x1 y1 x2 y2 Set the tablet input area in device coordinates in the form top left x/y and bottom right x/y. Top left and bottom right are defined in the device's native orientation, regardless of the actual rotation currently applied. Input outside of these coordinates will be clipped to the edges of the area defined. Default: 0 0 x2 y2; with x2 and y2 tablet specific.

MapToOutput [output] Map the tablet's input area to a given output (e.g. "VGA1"). Output names may either be the name of a head available through the XRandR extension, or an X11 geometry string of the form WIDTHxHEIGHT+X+Y. To switch to the next available output, the "next" keyword is also supported. This will cycle between the individual monitors connected to the system, and then the entire desktop. The mapping may be reset to the entire desktop at any time with the output name "desktop". Users of the NVIDIA binary driver should use the output names "HEAD-0" and "HEAD-1" until the driver supports XRandR 1.2 or later.

The output mapping configuration is a onetime setting and does not track output reconfigurations; the command needs to be re-run whenever the output configuration changes. When used with tablet rotation, the tablet must be rotated before it is mapped to the new screen. This parameter is write-only and cannot be queried.

Do you also use the rotation option ?

Rotate none|half|cw|ccw Set the tablet to the given rotation: none: the tablet is not rotated and uses its natural rotation half: the tablet is rotated by 180 degrees (upside-down) cw: the tablet is rotated 90 degrees clockwise ccw: the tablet is rotated 90 degrees counter-clockwise

Rotation is a tablet-wide option: rotation of one tool affects all other tools associated with the same tablet. When the tablet is physically rotated, rotate any tool to the corresponding orientation. Default: none

Quotes from the xsetwacom man page: https://linux.die.net/man/1/xsetwacom

Deevad commented 3 years ago

Hi @stefan123t ,

Can we use animated brushes in Krita too like in GIMP?

Yes, Krita support *.gih brush tip (animated). But also has many other options that goes beyond Gimp set for brush stroke.

An example setting for keys can be seen in David Revoy's screencast

Yes, I use 'Ctrl' alone on the first side button of my stylus (named 'button 2' because 'button 1' refers to the stylus tip), I can color pick while painting. I do that a lot (src: on my timelapses see the color history moves under the color selector).

heavy use of the Tablet Area Mapping

Yes, rarely the ratio of tablet matches the monitors. My tablet is also a Intuos4XL, I have a custom mapping for selecting on it a 16:9 area, not too little, not too big. I also map to my main monitor; I access my second monitor with the mouse.

Do you also use the rotation option ?

No, but it is very important for left handed that require to rotate their tablet 180° (to get buttons on right, many models are designed for that).

NextWorldVR commented 1 year ago

All a waste of time.

Shift-Ctrl and Alt are not sent as Keystrokes to be assigned to a Wacom Button.,

There is a MODIFIERS option where one can choose what MODIFIERS to assign to any given key.

ugh.

mindinsomnia commented 1 year ago

There is a MODIFIERS option where one can choose what MODIFIERS to assign to any given key.

How?

haplorhine commented 1 year ago

Hi @NextWorldVR I have problems comprehending your comment.

All a waste of time.

What exactly is a waste of time?

Shift-Ctrl and Alt are not sent as Keystrokes to be assigned to a Wacom Button.,

Unfortunately I don't understand this sentence. Why are they not sent? In other desktop environments e.g Gnome and KDE "Alt", "Ctrl" and "Shift" can be assigned to a Wacom Button.

There is a MODIFIERS option where one can choose what MODIFIERS to assign to any given key.

Where is this option?

ugh.

Merriam Webster defines this combination of letters as "used to indicate the sound of a cough or grunt or to express disgust or horror". I'm not sure about the context of this utterance. Please elaborate this further.