From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: How bind "Super" key *all by itself* to a function? Date: Mon, 19 Jan 2015 05:54:43 -0800 (PST) Message-ID: <8af00dd6-25e5-48c7-98cf-0b633a2d10e3@googlegroups.com> References: <43af9344-5981-4250-a825-47e119c1633e@googlegroups.com> <50ee152f-7dd7-4325-8b38-728e3e971338@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1421675725 1108 80.91.229.3 (19 Jan 2015 13:55:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2015 13:55:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 19 14:55:24 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YDCnb-00046p-Is for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jan 2015 14:55:23 +0100 Original-Received: from localhost ([::1]:37592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDCnb-0000Oc-2M for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jan 2015 08:55:23 -0500 X-Received: by 10.182.199.66 with SMTP id ji2mr4550118obc.45.1421675684608; Mon, 19 Jan 2015 05:54:44 -0800 (PST) X-Received: by 10.50.178.180 with SMTP id cz20mr231275igc.14.1421675684518; Mon, 19 Jan 2015 05:54:44 -0800 (PST) Original-Path: usenet.stanford.edu!r10no1360783igi.0!news-out.google.com!qk8ni9169igc.0!nntp.google.com!r10no1360772igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.95.2.246; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 59.95.2.246 User-Agent: G2/1.0 Injection-Date: Mon, 19 Jan 2015 13:54:44 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:209878 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102157 Archived-At: 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: = 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 . > > 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 , namely, > 96. > > So: > > === > = 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