LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Disabling the Win keys (http://www.linuxquestions.org/questions/slackware-14/disabling-the-win-keys-4175493711/)

Woodsman 02-04-2014 01:18 PM

Disabling the Win keys
 
I've been searching the web for a solution but I must be using all of the wrong key words. I am not finding a way to disable the two Win keys common on most keyboards nowadays.

I prefer this to be system wide, something in xorg.conf.d, or rc.local.

Thanks. :)

titopoquito 02-04-2014 02:57 PM

I guess you are looking for something like this:

http://wiki.bodhilinux.com/doku.php?...able_caps_lock

I think with xev you should be able to detect which symbol the win keys actually have. Don't know though where to put this to make it available for all users - if you know it, an update is appreciated :)

brianL 02-04-2014 03:09 PM

Why disable them? Why not use them for something useful (don't ask me what :) )?

j_v 02-04-2014 05:19 PM

I don't understand disabling. They are just keys. Some tiling wm's use these keys for kbd shortcuts. I'm not trying to be critical, but my curiosity is piqued.

TobiSGD 02-04-2014 05:27 PM

The Windows keys are commonly referred to as Meta4 (Alt for example is Meta1). If you have no keyboard combination configured that uses Meta4 the keys are effectively disabled.

Woodsman 02-04-2014 06:33 PM

I don't question the usages of other people when they ask for help. Geez. :)

I want to disable the keys because the only place I encounter them is on the laptop. My desktop keyboard does not have the keys. I keep inadvertently bumping the keys and I'm tired of popup menus appearing that interrupts my typing.

I hate laptop keyboards. Too small. Keys in non-standard locations. I use the laptop for testing. Sometimes I ssh into the laptop just to avoid using the keyboard. Yeah, I could buy an external full size keyboard to avoid the crappy design of a laptop keyboard....only to be confronted again with the Win keys.

Quote:

I guess you are looking for something like this:
That might help. Thanks.

Quote:

The Windows keys are commonly referred to as Meta4 (Alt for example is Meta1). If you have no keyboard combination configured that uses Meta4 the keys are effectively disabled.
That might help too. Thanks.

sycamorex 02-04-2014 06:47 PM

You can use 'xev' to find key codes and then see if that helps you:

http://www.linuxscrew.com/2008/09/15...-key-in-linux/

j_v 02-04-2014 06:48 PM

Quote:

Originally Posted by Woodsman (Post 5111622)
I don't question the usages of other people when they ask for help. Geez. :)

Sorry. But thanks for explaining anyways.

TobiSGD 02-04-2014 07:08 PM

Quote:

Originally Posted by Woodsman (Post 5111622)
I keep inadvertently bumping the keys and I'm tired of popup menus appearing that interrupts my typing.

Just out of curiosity, which DE or WM are you using?

Quote:

Yeah, I could buy an external full size keyboard to avoid the crappy design of a laptop keyboard....only to be confronted again with the Win keys.
Buy a gaming keyboard, those usually have a switch to disable the Windows keys.

j_v 02-04-2014 07:17 PM

Looking at the various xinitrc.* in /etc/X11/xinit, I see that you should be able to add your xmodmap option to /etc/X11/xinit/.Xmodmap to get system wide keycode/keysym settings.

With my keyboard, the file would be:

Code:

# /etc/X11/xinit/.Xmodmap

# disable the win key
keycode 133 =

I only have one win key.

Woodsman 02-04-2014 10:56 PM

Quote:

Just out of curiosity, which DE or WM are you using?
Most of the time Trinity, sometimes KDE4. The biggest culprit of the popup menu is kate/kwrite. Bumping the right Win key (Super_R?) is the same as a "right-click" in kate/kwrite. which invokes a context popup menu. I get the same behavior in KDE4 kate.

That said I tried adding /etc/X11/xinit/Xmodmap:

# disable the left win key
keycode 133 =
# disable the right win key
keycode 135 =

I tried ~/.Xmodmap and adding the xmodmap -e command in a desktop file in autostart. None of that works.

I still get the popup menu in kate, both Trinity and KDE4.

Yet I always could execute the xmodmap -e command in a terminal window and succeed.

Then I discovered that directly running 'xmodmap /etc/X11/xinit/Xmodmap' in a terminal window resulted in complaints. Oh. So I remove the comments in /etc/X11/xinit/Xmodmap. After removing the comments the file worked as intended when I started X.

Oh, wait! Comments in this file are marked by an exclamation mark, not a hash mark.

The damned Win keys now are impotent.

No. Wait.

The Xmodmap file works in Trinity but not KDE4. Almost exact same xinit scripts. Both scripts run the command 'xmodmap /etc/X11/xinit/Xmodmap'.

I can run 'xmodmap /etc/X11/xinit/Xmodmap' manually in a terminal window and the commands work in KDE4.

I can copy /etc/X11/xinit/Xmodmap to ~/.Xmodmap then the commands work in KDE4.

But from /etc/X11/xinit/Xmodmap KDE4 balks. Trinity plays ball.

I am clueless.

I picked the wrong week to stop sniffing glue. Next I'll discover I have a drinking problem. And that everybody is counting on me. Where is my auto-pilot?

P.S. Yes, I edited my xinit scripts to use /etc/X11/xinit/Xmodmap and not /etc/X11/xinit/.Xmodmap.

sycamorex 02-05-2014 02:14 AM

Have you tried what I suggested in post 7? You could possibly put it in rc.local.

TobiSGD 02-05-2014 04:03 AM

Quote:

Originally Posted by sycamorex (Post 5111855)
Have you tried what I suggested in post 7? You could possibly put it in rc.local.

rc.local will be of no help, when that is run the X server is not running.

FWIW, I use a ~/.Xmodmap file (for switching Escape and Caps-Lock) and it works fine, but that depends on how your ~/.xinitrc looks like. This is for example the one Slackware has for KDE:
Code:

#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi


if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi


# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
    ck-launch-session startkde
else
    startkde
fi

I have marked the important parts in bold, basically it says: If a file sysmodmap=/etc/X11/xinit/.Xmodmap exists, load it, but override it with ~/.Xmodmap, if it exists.

brianL 02-05-2014 10:13 AM

Quote:

Originally Posted by Woodsman (Post 5111622)
I don't question the usages of other people when they ask for help. Geez. :)

Vewwy sowwy, I weally am. :D

stf92 02-05-2014 11:51 AM

Quote:

Originally Posted by Woodsman (Post 5111622)
I hate laptop keyboards. Too small. Keys in non-standard locations. I use the laptop for testing. Sometimes I ssh into the laptop just to avoid using the keyboard. Yeah, I could buy an external full size keyboard to avoid the crappy design of a laptop keyboard....only to be confronted again with the Win keys.

I hate them too. And they were the cause to go from concave keyboards to flat ones.


All times are GMT -5. The time now is 10:26 AM.