QUEST OVER.
THIS INSTALL SCRIPT WILL ENABLE FRONT PANEL BUTTONS AND ADD A ROTATE SCRIPT TO YOUR CF-19 ON LINUX. It won't bind the buttons to the rotate script or any other events since that is dependent on your desktop environment and hotkey utilities, so you have to figure that out with the help of this thread, which I guess is sort of a side quest.

Anybody care to test this out on a CF-19?
Now this really bugs me because I have already installed this module a long time ago and never followed through with binding a rotate script. I can't find that original discussion either here or in NBR.
EDIT: Actually I found it and it was
previously discussed here. I found all the info, bookmarked it all then forgot it. I must have simply become busy or uninterested in pursuing it for some reason, or I'm simply losing my mind.
EDIT 2: Credit goes to Favux on the LInux Mint forums for his
Tablet PC Rotation How to.
Heiher for the
panasonic_hbtn kernel module
scotti4442 here on TBT for finding this stuff about a year ago. Where is that dude? He hasn't logged in here since May last year.
And thanks to
glitch for helping light a fire under my ass with this thread. I have a bad habit of not finishing stuff I start around here.
EDIT 3: Added checks for xrandr and xinput in script, with a few other touch-ups.
Brief summary:
1) unzip the file
2) run install.sh as root or sudo
3) assign XF86RotateWindows to /usr/local/bin/rotate in your appropriate hotkey editor utility.
WHAT YOU NEED FIRST:
Check that you have
make,
xinput and
xrandr by just typing the commands to see if they exist.
On Debian, make and xinput are provided by packages of the same name and xrandr is part of x11-xserver-utils.
For make, you might also need header files which is provided by the metapackage
linux-headers on Debian. You'll realize this when the make portion of the script runs and throws up "missing header" or similar errors.
Download the panasonic-hbtn.zip file attached to this message. It contains the CF-19 kernel module to enable the front buttons, the rotate script for rotating your screen while transposing tablet calibration coordinates and an easy to use install script that I also discuss a bit in this message. Unzip the file with whichever method suits you, filemanager or command then run the install.sh script as a superuser. You might need to reboot.
For example, I have downloaded this in /home/nick
The file is effectively /home/nick/panasonic-hbtn.zip
I have unzipped it and the resulting directory is /home/nick/panasonic-hbtn
Then I will change directories into /home/nick/panasonic-hbtn with a shell/terminal to run the install.sh script contained therein.
(cd /home/nick/panasonic-hbtn)
If you use sudo:
If you're like me and don't use sudo then login as root or su
This is a quick and dirty shell script that will
1) check that you are root
2) check for the presence of 'make'
3) try to compile the module then install it if it's not already there
4) copy the rotate script in /usr/local/bin
5) warn you if you are missing xinput and xrandr in your $PATH
If it works, you should be able to test it by typing "rotate" in a shell and your screen will rotate while keeping your tablet calibrated.
It's not the most well thought-out script so it might fail. For starters, I'm not checking for header files or missing symbols. It won't destroy your system, however. This is the contents of install.sh that I am asking you to test (again, it's already in the zip file):
Code: Select all
#!/bin/bash
ISMOD=`lsmod|grep panasonic_hbtn`
ISMAKE=`which make`
ISXINPUT=`which xinput`
ISXRANDR=`which xrandr`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
if [ "$EUID" -ne 0 ]
then printf "Please run as root\n"
exit
fi
if [ -n "$ISMOD" ]
then
printf "The panasonic_hbtn module is already installed.\n\n"
printf "Copying the rotate script to /usr/local/bin \n\n"
cp -i rotate /usr/local/bin
chmod +x /usr/local/bin/rotate
exit
fi
if [ -n "$ISMAKE" ]
then
printf "Installing Panasonic front panel button module...\n\n"
make clean
make
insmod panasonic-hbtn.ko
printf "Copying the rotate script to /usr/local/bin \n\n"
cp -i rotate /usr/local/bin
chmod +x /usr/local/bin/rotate
else
printf "\"make\" command not found!\n"
printf "You need to have a valid compiler installed.\n"
printf "You might need to install \"make\" or check to see if it's in your PATH.\n"
exit
fi
if [ ! -n "$ISXINPUT" ]
then printf "You need to install \"xinput\" for the rotate script to work.\n"
fi
if [ ! -n "$ISXRANDR" ]
then printf "You need to install \"xrandr\" for the rotate script to work.\n"
fi
The only relevant section in this install script above are the following commands that we are discussing in this thread, which you could execute individually:
Code: Select all
make
insmod panasonic-hbtn.ko
cp rotate /usr/local/bin
chmod +x /usr/local/bin/rotate
This kernel module that glitch dug up again only may only work partially. The keyboard button does not work for me, but seemed to work for scotti4442 and he had another key that didn't work. I am not sure if this hardware or software related, yet. Help!
How you link these buttons to what you want them to do, like execute the rotate script, is dependent on your desktop environment or window manager. You would have to have a hotkey utility that allows you to assign applications or scripts to keyboard event names. It would be great if some of you could detail how it's done with whatever you're running.
The event names are as follows, left to right on the CF-19's front panel:
XF86MonBrightnessDown
XF86MonBrightnessUp
(keyboard button doesn't work for me)
Return
XF86RotateWindows
XF86ScreenSaver
The first two seemed to work without the kernel module. What the heck is Return used for? (don't re-map this). XF86ScreenSaver is presumably used with a Windows screensaver that is configured to ask for a password on wakeup.
With my Debian LXDE Openbox, I added this to ~/.config/openbox/lxde-rc.xml between the <keyboard> </keyboard> sections. Disregard if you're not running Openbox:
Code: Select all
<keybind key="XF86RotateWindows">
<action name="Execute">
<command>/usr/local/bin/rotate</command>
</action>
</keybind>