LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-04-2014, 01:18 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
Old 02-04-2014, 02:57 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
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
 
Old 02-04-2014, 03:09 PM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Blog Entries: 61

Rep: Reputation: Disabled
Why disable them? Why not use them for something useful (don't ask me what )?
 
Old 02-04-2014, 05:19 PM   #4
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
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.
 
Old 02-04-2014, 05:27 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 02-04-2014, 06:33 PM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
1 members found this post helpful.
Old 02-04-2014, 06:47 PM   #7
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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/
 
Old 02-04-2014, 06:48 PM   #8
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
Quote:
Originally Posted by Woodsman View Post
I don't question the usages of other people when they ask for help. Geez.
Sorry. But thanks for explaining anyways.
 
Old 02-04-2014, 07:08 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Woodsman View Post
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.
 
Old 02-04-2014, 07:17 PM   #10
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
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.
 
Old 02-04-2014, 10:56 PM   #11
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.

Last edited by Woodsman; 02-04-2014 at 10:58 PM.
 
1 members found this post helpful.
Old 02-05-2014, 02:14 AM   #12
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Have you tried what I suggested in post 7? You could possibly put it in rc.local.
 
Old 02-05-2014, 04:03 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by sycamorex View Post
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.
 
Old 02-05-2014, 10:13 AM   #14
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,311
Blog Entries: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by Woodsman View Post
I don't question the usages of other people when they ask for help. Geez.
Vewwy sowwy, I weally am.
 
Old 02-05-2014, 11:51 AM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Quote:
Originally Posted by Woodsman View Post
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.

Last edited by stf92; 02-05-2014 at 12:02 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem re-mapping non-standard keys to modifier keys tias42 Linux - General 4 04-09-2011 05:03 AM
mouse keys as modifier keys (ctrl & alt) belda Linux - Desktop 3 06-25-2009 10:37 AM
USB keyboard function keys/numeric keys on boot raypen Linux - Hardware 4 04-17-2008 03:07 PM
WOL lin->win fails, win->win works? c0uchm0nster Linux - Networking 1 01-07-2007 11:33 PM
howto enable win keys for mandrake spikeyklitske Linux - Software 0 10-31-2004 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration