all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How bind "Super" key *all by itself* to a function?
Date: Mon, 19 Jan 2015 05:54:43 -0800 (PST)	[thread overview]
Message-ID: <8af00dd6-25e5-48c7-98cf-0b633a2d10e3@googlegroups.com> (raw)
In-Reply-To: <mailman.18131.1421658484.1147.help-gnu-emacs@gnu.org>

On Monday, January 19, 2015 at 2:38:06 PM UTC+5:30, Yuri Khan wrote:
> [Damn Gmail. Its Send button is too near the "show quote" button and
> too high-contrast.]
> 
> On Mon, Jan 19, 2015 at 1:35 PM, Rusi  wrote:
> 
> >> However, you can use XKB (in X) and/or loadkeys (in tty) to map the
> >> Windows key to produce a different keycode such as F13, and then bind
> >> that to any function you like.
> >
> > Do you have a simple howto on that? [XKB]
> > With xmodmap it was at least conceivable
> > Xkb is too much of a dragon
> >
> > eg Say I have a broken ~ key and I want to make F12 generate ~
> 
> Not quite qualifies as "simple" but not very complicated.
> 
> * Find the XKB data directory. [Normally, this is /usr/share/X11/xkb.]
> * In its "keycodes" subdirectory, create a file that is unlikely to be
> overwritten by a future version of XKB (e.g. by prefixing it with your
> initials). [Let's name it "rusi" for the sake of this example.]
> * In this file, paste the following:
> 
> ===
> xkb_keycodes "f12tilde" {
>     # remappings go here...
> };
> 
> # you can have multiple remapping sections
> # and activate any subset thereof, just add more
> # xkb_keycodes "some_name" {
> #   # ...
> # };
> ===
> 
> Each remapping takes the form: <KEYNAME> = KEYCODE;
> 
> Refer to the existing entries in the section "default xkb_keycodes
> "evdev"" for key names and codes.
> 
> For keyname, find the name of the key you want to generate. In your
> case, it's <TLDE>.
> 
> For keycode, find the numeric code of the key you want to remap. In
> your case, it's the code which is normally bound to <FK12>, namely,
> 96.
> 
> So:
> 
> ===
>     <TLDE> = 96;
> ===
> 
> * Now that you have a keycodes section of your own, make a
> corresponding option. In the rules/evdev file, find the following
> header:
> 
> ===
> ! option = keycodes
> ===
> 
> In that section, add something like:
> 
> ===
>   rusi:f12tilde = +rusi(f12tilde)
> ===
> 
> Here, the form on the right refers to the keycodes filename and
> section, and the name on the left specifies the option name.
> 
> * Next, you want your X server to pick up this option. You can do it
> system-wide or per-user; I'll describe the system-wide setup because I
> find it easier and less DE-specific.
> * In the /usr/share/X11/xorg.conf.d directory [or its equivalent on
> your system], create a uniquely named file [e.g.
> 11-rusi-keycodes.conf]:
> 
> ===
> Section "InputClass"
>     Identifier "Keyboard layouts"
>     Driver "evdev"
>     Option "XkbOptions" "rusi:f12tilde"
>     Option "AutoServerLayout" "on"
>     MatchIsKeyboard "on"
>     MatchDevicePath "/dev/input/event*"
> EndSection
> ===
> 
> In the XkbOptions line, refer to the option name you added to rules/evdev.
> 
> Next time you boot X or plug in a keyboard, it should use your customization.
> 
> You can check the current set of XKB options by executing the
> following command in a terminal emulator within an X session:
> 
> $ setxkbmap -query
> 
> ----
> 
> Legend has it that there is a possibility of using xkbcomp(1) on a
> user-specific configuration file, but I never learned that;
> system-wide is good enough for me.
> 
> One caveat: whenever you update the package that contains the
> rules/evdev file, it may be overwritten and you might have to re-add
> your option line.

You are my sweetheart!

Its going to take me some time to figure this out but
as you may see from my last blog-post
http://blog.languager.org/2015/01/unicode-and-universe.html
I am currently fascinated by being able to type unicode


  parent reply	other threads:[~2015-01-19 13:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  6:57 How bind "Super" key *all by itself* to a function? Chris Seberino
2015-01-19  7:16 ` Yuri Khan
     [not found] ` <mailman.18124.1421651779.1147.help-gnu-emacs@gnu.org>
2015-01-19  7:35   ` Rusi
2015-01-19  8:25     ` Yuri Khan
2015-01-19  9:08     ` Yuri Khan
     [not found]     ` <mailman.18131.1421658484.1147.help-gnu-emacs@gnu.org>
2015-01-19 13:54       ` Rusi [this message]
2015-01-19 14:33       ` Rusi
2015-01-19 15:32         ` Yuri Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8af00dd6-25e5-48c7-98cf-0b633a2d10e3@googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.