Disabling a specific key

jd1008 jd1008 at gmail.com
Fri Dec 19 17:18:51 UTC 2014


On 12/19/2014 03:27 AM, Rolf Turner wrote:
> On 19/12/14 13:56, jd1008 wrote:
>>
>> On 12/18/2014 05:29 PM, Rolf Turner wrote:
>>> On 19/12/14 11:55, Marko Vojinovic wrote:
>>>> On Fri, 19 Dec 2014 10:34:54 +1300
>>>> Rolf Turner <r.turner at auckland.ac.nz> wrote:
>>>>> On 19/12/14 08:27, jd1008 wrote:
>>>>>>
>>>>>> If you do not know the KeyCode, run the program:
>>>>>> showkey
>>>>>>
>>>>>> and press the key in question
>>>>>> and it's code will be displayed.
>>>>>> You must wait 10 seconds of idle
>>>>>> and showkey program will exit;
>>>>>> then run the sudo script above.
>>>>>>
>>>>>
>>>>> This looks very useful to me .... but as usual I fall at the first
>>>>> hurdle.  When I type showkey or "showkey -k" I get:
>>>>>
>>>>>> Couldn't get a file descriptor referring to the console
>>>>>
>>>>> And that's it.  Anything I can do about this?  (Please note: I am
>>>>> running Fedora 17 --- yes, I know --- and using a Mate desktop; Mate
>>>>> 1.6.1 .)
>>>>
>>>> You need to run showkey in a proper virtual terminal, aka ctrl-alt-f3
>>>> or such. It was not designed to work under X.
>>>>
>>>> HTH, :-)
>>>
>>> Did not help, I'm afraid.  I did ctrl-alt-f3 and *absolutely nothing*
>>> happened.
>>>
>>> I (repeatedly) tried using "xev" as was proposed by someone else, to
>>> discern the keycode for the key I wished to disable.  The output was
>>> prolific and profuse and incomprehensible.  However after trying *one
>>> more time* and scrolling back through the plethora of output I managed
>>> to guess that the keycode I needed was "67".
>>>
>>> So I did:
>>>
>>> xmodmap -e "keycode 67 = NoSymbol"
>>>
>>> That was accepted without throwing an error, and blow-me-down, the key
>>> in question seemed to be disabled.  Success?  No, not quite.
>>>
>>> I then restarted the system to see if the effect would persist. It
>>> didn't!
>>>
>>> It would appear that I have to issue the "xmodmap" command every time
>>> that I reboot.  Not a *big* deal, but annoying.  Is there a way to make
>>> the effect persist?
>>>
>>> I tried put the line
>>>
>>> keycode 67 = NoSymbol
>>>
>>> into the file /etc/X11/Xmodmap, but that seemed to have no effect.
>>>
>>> Any other ideas?  Ta.
>>>
>>> cheers,
>>>
>>> Rolf Turner
>>>
>> Rolf, did you see my other replies?
>
> Well, yes. I've read all the postings in this thread.  A lot of what 
> was said I did not understand.
>
>> You want to do this under the aegis of X server, right?
>
> I'm not sure, but I don't think so.  I just want to disable the key.
> I am running the Mate desktop under Fedora 17.  The "X" (X11?) system 
> is "there" but not paramount, in my limited understanding.
>
>>
>> Please tell me what key you wish to disable, and I will show
>> you how to do it from within a gnome terminal.
>
> The key is the "F1" key (function 1) --- labelled most prominently 
> with a question mark: "?".  It is next to the ESC key, which I use 
> frequently
> (being a vi/vim user) and although not all *that* physically proximate,
> it is close enough so that I often hit it when I reach for the ESC key.
> (My clumsiness, I guess.) When it is pressed it pops up a Gnome help 
> menu, in which I have no interest.
>
>> Remember, that the modification might not affect the web browser.
>> So, leave the web browser out of this.
>
> Gladly!
>
> cheers,
>
> Rolf  Turner
>
> P. S.  The machine in question is a Toshiba Satellite L850 laptop.
>
> R. T.
>
Rolf, I can disable it after I login and X is up and running and I use 
gnome-terminal .
In gnome-terminal
click edit-> Preferences -> Shortcuts
Under shortcuts, scroll down to the line which shows:

Contents                                  F1

doube-click on F1 and text will appear saying  New Accelerator
Now press the backspace key and it will be disabled.
Click Close.

Now F1 key will be inoperative.

Some apps will not honour the disabled status of that key.
Case in point: mate-terminal.
But gnome-terminal does honour the disabled state of the key.




More information about the users mailing list