The developers offered help but ultimately didn’t know the answer.
Here’s a temporary solution:
Install the xbindkeys package. XBindKeys There is a repository which has it, but, I compiled from source. Run “configure --disable-guile” then “make” then “make install”. The default installation puts things in good places. There is something up with the guile libraries from opensuse repositories that the code doesn’t like.
xbindkeys will allow you to intercept a keycode and execute a program in response. If you want to see the keycodes, install & use “xev” the X Event Viewer. You set up xbindkeys on a per-user basis by running “xbindkeys --defaults” from the user account. It creates the file .xbindkeysrc in the user’s home directory. You need to configure this file, or, you can use mine. Keep in mind that the default .xbindkeysrc hooks control-f to open a terminal. This is A Bad Thing™ because it hooks it from absolutely every application, breaking the control-f that you typically use to open a search window. Keep in mind that I’m using KDE, so, I selected “Konsole” for my terminal window in .xbindkeysrc. You may want xterm or your favorite shell window. I also use xournal as my tablet writing software. This comes up when you press the tablet button right below rotate screen. This really should invoke a virtual keyboard, but, I haven’t figured out that part yet.
My .xbindkeysrc:
For the benefit of emacs users: -- shell-script --
###########################
xbindkeys configuration
###########################
Version: 1.8.5
If you edit this file, do not forget to uncomment any lines
that you change.
The pound(#) symbol may be used anywhere for comments.
To specify a key, you can use ‘xbindkeys --key’ or
‘xbindkeys --multikey’ and put one of the two lines in this file.
The format of a command line is:
“command to start”
associated key
A list of keys is in /usr/include/X11/keysym.h and in
/usr/include/X11/keysymdef.h
The XK_ is not needed.
List of modifier:
Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
Mod3 (CapsLock), Mod4, Mod5 (Scroll).
The release modifier is not a standard X modifier, but you can
use it if you want to catch release events instead of press events
By defaults, xbindkeys does not pay attention with the modifiers
NumLock, CapsLock and ScrollLock.
Uncomment the lines above if you want to pay attention to them.
#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable
Examples of commands:
“xbindkeys_show”
control+shift + q
set directly keycode (here control + f with my keyboard)
“konsole”
c:41 + m:0x4
specify a mouse button for opening a shell window
“konsole”
control + b:2
Open file manager
“/usr/bin/thunar”
control+Mod1 + f
rotate screen
“/usr/sbin/x61_rotate 4”
XF86TouchpadToggle
Throw up xournal
“/usr/bin/xournal”
XF86ScreenSaver
#“xterm -geom 50x20+20+20”
Shift+Mod2+alt + s
set directly keycode (here control+alt+mod2 + f with my keyboard)
#“xterm”
alt + c:0x29 + m:4 + mod2
Control+Shift+a release event starts rxvt
#“rxvt”
release+control+shift + a
Control + mouse button 2 release event starts rxvt
#“rxvt”
Control + b:2 + Release
##################################
End of xbindkeys configuration
##################################
I’ve installed a script /usr/sbin/x61_rotate. You’ll need to install a similar script or use mine. My script has been hacked together from one originally from dmg. As you can see it’s kind of crufty and requires xrandr and xsetwacom (make sure you have those installed). There is allegedly a way to do everything from xrandr, but, I haven’t figured it out yet.
My rotation script. Make sure you have perl installed and at the right place. My perl is from the main respository, so, it shoudl work. Copy this script to /usr/sbin/x61_rotate and then “chown root:root /usr/sbin/x61_rotate” then “chmod o+x,g+x,u+x /usr/sbin/x61_rotate”.
#!/usr/bin/perl
use strict;
my $wacomDevice = ‘“Serial Wacom Tablet stylus”’;
my %rotation = (
“normal” => 0,
“right” => 1,
“inverted” => 2,
“left” => 3,
);
my @rotationInv = (
“normal”,
“right”,
“inverted”,
“left”
);
#98 => up
#100=> left
#103 =>right
#100=>down
Set the thumb-toggle on tablet display depending on orientation
my @keycodesComplete = (
“0x71 103 0x6f 108 0x6e 105 0x6d 106”,
“0x71 105 0x6f 106 0x6e 108 0x6d 103”,
“0x71 108 0x6f 103 0x6e 106 0x6d 105”,
“0x71 106 0x6f 105 0x6e 103 0x6d 108”);
my @keycodes = (‘111’, ‘113’,‘116’,‘114’);
my @mapKeys = (‘Up’, ‘Left’, ‘Down’, ‘Right’);
Translate current rotation into the rotation values of this script
my $current = Find_Display_Rotation();
my @wacom = (’“NONE”’, ‘“CW”’, ‘“HALF”’, ‘“CCW”’);
Get input
my $next = $ARGV[0];
The + is rotation clockwise, - rotation counterclockwise
The 0-3 correspond to %rotation & @wacom arrays
if ($next >= 0 && $next <= 3) {
$current = $next;
}
elsif ($next eq “4”) {
if ($current == 0) {
$current = 3;
}
elsif ($current == 3) {
$current = 0;
}
}
elsif ($next eq “-”) {
$current --;
} elsif ($next eq “+” ) {
$current ++;
} elsif ($next eq “”) {
$current ++;
} else {
$current = $next;
}
Make sure we’re between 0 and 3 with the rotation setting
$current %=4;
print "Setting to : $current
";
die “invalid current $current]” unless $current >= 0 and $current <4;
set xrandr
print "Setting $rotationInv$current]
";
print xrandr -display :0.0 -o $rotationInv$current]
;
#print xrandr -display :0.0 --output LVDS --pos 0x0
;
print “xsetwacom --set $wacomDevice Rotate $wacom$current]”;
print xsetwacom --set $wacomDevice Rotate $wacom$current]
;
#print xmodmap -e 'keycode 146 = Menu'
;
#print sawfish-client --display :0.0 -e '(dmg-move-current-window-inside)'
;
#Set_Wacom_Tablet();
This command would set the thumb toggle buttons based on rotation
set_keys($current);
exit;
sub Set_Wacom_Tablet
{
my ($currentRotation) = @_;
# x1, y1, x2, y2
my @coor = ( -27, 47, 18509, 24701);
my @where = (“topx”, “topy”, “bottomx”, “bottomy”);
my $command = “/usr/bin/xsetwacom”;
if ($current %2 == 1) {
for my $i (0..3) {
print `$command set eraser $where$i] '$coor$i]'`;
print `$command set stylus $where$i] '$coor$i]'`;
}
}
}
sub Find_Display_Rotation
{
my $mode = /usr/bin/xrandr --verbose| grep LVDS
;
if ($mode =~ / +([a-z]+) +\(/) {
} else {
print STDERR "UNable to detect mode $mode
";
die;
}
die "($mode) ($1) " if ($1 ne “right” and
$1 ne “left” and
$1 ne “inverted” and
$1 ne “normal”);
return $rotation{$1};
}
sub set_keys
{
my ($rotation) = @_;
my ($a) = $keycodesComplete$rotation];
print /bin/setkeycodes $a
;
}
This particular hack uses the screen rotate button on the tablet to toggle back and forth between the typical landscape and portrait positions. It’s not the ideal behavior. The ideal behavior is for the rotate screen button to rotate sequentially to all orientations and for the tablet swivel position switch to indicate toggling between typical positions. I can’t figure out where to access the tablet swivel. I’ll get back here with a new post when I find it.
@DenverD: This is what helping looks like. This level of effort wouldn’t be necessary if everyone upstream had documented their changes. So, I have a right to be angry, and, you shouldn’t have anything to say to me about that.