0

Here is the relevant part of my .xbindkeysrc file. The first commented line gives you idea of what I am trying to achieve.

# System-wide equivalence of Shift-Del, Ctrl-Ins, Shift-Ins and Ctrl-X, Ctrl-C, Ctrl-V, respectively

# "xvkbd -xsendevent -text '\Cx'"
"xdotool key 'Control_L+x'"
Shift + Delete + Release

# "xvkbd -xsendevent -text '\Cc'"
"xdotool key 'Control_L+c'"
Control + Insert + Release

# "xvkbd -xsendevent -text '\Cv'"
"xdotool key 'Control_L+v'"
Shift + Insert + Release

At the beginning, I was totally happy with solution based on xvkbd utility (commented lines), until I realised it did not work in Gnome applications.

So I had to switch to xdotools in stead. For some reasons, it is only the second block (corresponding to the copying operation) that is working. I need your advice on what to change in the other two blocks.

S. N.
  • 175
  • 1
  • 3
  • 11
  • I configured my xbindkeys using `xte` rather than `xdotool` and I saw another post here today where someone asked a similar question and solved it by using xte so do a search on that, it may work for you? As an example my line for workspace down is of this format: `"xte 'keydown Super_L' 'key Page_Down' 'keyup Super_L' &"` – codlord May 19 '20 at 19:18
  • I would guess that the modifiers are the culprit. When you press shift+delete and that triggers ctrl+x, you actually press ctrl+shift+x, which in many applications will probably not trigger a "cut" operation. Try `--clearmodifiers` (see `man xdotool`). – danzel May 19 '20 at 22:02
  • @codlord Thank you for your suggestion, but it did not work for me. I replaced the xdotools action strings with strings like "xte 'sleep 3' 'keydown Control_L' 'keydown c' 'keyup Control_L' 'keyup c'" for copying. It has had no effect... – S. N. May 21 '20 at 10:59
  • @danzel This --clearmodifiers switch works too good in some sense. It disables the control modifier needed for all three operations. So "xdotool key --clearmodifiers 'Control_L+c'" results in typing the "c" letter. – S. N. May 21 '20 at 11:03
  • What puzzles me is that judging by its extensive man page, a lot of work has come into xdotool utility. It seems to be well thought-out and matured utility. I guess my case does not include any complex or exotic actions, it is fairly straight forward and simple one and the program fails. I probably miss some thing... – S. N. May 21 '20 at 11:09
  • @S.N. are you sure that `Control_L` is a valid key specifier for `xdotool`? I'd try `ctrl+c` etc. instead. I could also imagine that `xdotool` behaves differently when you use the keysym for a modifier, e.g. it maybe doesn't set the modifier map for the other keys in that case. – danzel May 23 '20 at 07:19
  • @danzel I quote the manual page for xdotool: «Aliases exist for "alt", "ctrl", "shift", "super", and "meta" which all map to Foo_L, such as Alt_L and Control_L, etc.». I can confirm any of these two variants working. At least, I have not noticed any differences. – S. N. May 24 '20 at 09:37

2 Answers2

0

I found the following string to work for me (copying operation as an example):

"xset r off; xdotool key --clearmodifiers 'Control_L+c'; xset r on"
Control + Insert + Release

Based on the accepted answer for this thread.

S. N.
  • 175
  • 1
  • 3
  • 11
0

below was perfect until a day to close firefox tab by side button:

" xdotool key 'control + w' " b:9

it does not run anymore. finally below works:

"xte 'keydown Control_L' 'key w' 'keyup Control_L'" b:9 + Release