My Windows PC died of old age recently, so I was forced to use my Samsung Ativ 700t tablet with Kubuntu 17.10 on it. Setting it up has been a bucket of pain, so I decided to help anyone who finds themselves in my position by providing guides that helped me. If you don't find what you need here, check out #beholderveekubuntuguides , there might be the thing you're looking for.
Right Click not working? How to remap Hardware Buttons? Here's a solution.
Right Click on Touchscreen
I tried to find away to make a right click trigger when a finger is held down, but being a total noob at Linux, I failed. There is, however, an incredibly simple workaround. Install Onboard the on-screen keyboard from the Plasma Discover market, it comes packed with not only a convenient on-screen keyboard, but also keys that, when pressed, activate middle click, right click and double click. Nice piece of software.
If you install the Vivaldi browser you'll get right click on tap and hold functionality within the browser out of the box, as well as drag to scroll, unlike firefox, which requires extensions that don't even work in it's more recent versions.
Remapping Hardware Buttons
If you're like me and you have a Windows key below your touchscreen, and maybe a key that toggles automatic screen rotation, you feel cheated, because both these buttons are almost utterly useless in Kubuntu
( On my Samsung Ativ 700t the Windows key works as a Super key, which is useless without a keyboard, but is obsolete if you do have a keyboard, since a keyboard also has it, and in a more convenient place. The rotation toggle key is Meta+O, which does nothing by default.)
You might want to remap these keys. Well, let's start with the-
Windows key
Actually, summoning the launcher menu is done out of the box in the newer releases of Plasma, so here I'm going to tell you how to change that default behavior to a different one.
You'll need to install KSuperKey. Follow this link, it has a pretty simple instruction, even for such a noob as me. Don't forget to set ksuperkey to start by default, the way to do it is also specified on the linked page.
However, since we already have the default behavior and want a different action on this button press, instead of
ksuperkey -t 300ms
put
ksuperkey -e 'Super_L=KEY'
where KEY is the key you want to activate on press. Examples include (remove commass) 'space' for the space bar, 'Alt_L|F2' for Alt+F2 and so on.
The list of key names is found in the header file X11/keysymdef.h (remove the XK_ prefix). Note that due to limitations of X11 shifted keys must be specified as a shift key followed by the key to be pressed rather than the actual name of the character. For example to generate "{" the expression 'ModKey=Shift_L|bracketleft' could be used (assuming that you have a key with "{" above "[").
You can also remap other buttons with KSuperKey, like so:
ksuperkey -e 'Control_L=Escape;Super_L=Alt_L|F2'
This will make Left Control generate Escape when pressed and released on its own, and Left Super generate Alt+F2 combination when pressed and released on its own.
You'll also need to disable Plasma summoning the launcher menu, so only the behavior we set above triggers. Open your home folder with a file editor, tick 'show hidden files', where that option is depends on your file browser, then go to .config. There open a file titled 'kwinrc', and add this line to the bottom of it:
[ModifierOnlyShortcuts]
Meta=
Reboot your machine.
Done? Now onto the-
Any other button you want to re-assign, that happens to trigger a modifier+key combination by default (Meta+o in my case)
First install xdotool.
Open Konsole, then run
sudo apt-get update
sudo apt-get install xdotool
Next, go to System Settings -> Shortcuts -> Custom Shortcuts. Press the 'Edit' button, then 'New', then 'Global Shortcut', then 'Command/URL'. Name your new shortcut something relevant, 'Escape Key', for example. Click it. Go to the 'trigger' tab. Press the 'shortcut' button. It should ask you for input. Press the hardware button you want to reassign. Good.
Go to the 'Action' tab. You may type in a regular Konsole command, but we're interested in triggering a key press. Type in
xdotool key KEY
where key is the key you want to trigger. These are not the same as in the "Windows key" section. Examples Include 'space', 'Escape' (capitalization of first letters is not optional) and so on. You'll have to google the exact keywords for xdotool.
That concludes this little guide. Do point out any inaccuracies in the comment section, I'll try to fix them. Just don't forget I'm a total noob and just put out the methods I used to set up my Kubuntu so people don't have to suffer like I did.