Remap the hash key

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
dude_cor392
Level 1
Level 1
Posts: 6
Joined: Mon Jan 25, 2016 2:50 pm

Remap the hash key

Post by dude_cor392 » Mon Jan 25, 2016 2:54 pm

Hi guys, pretty much brand new to Linux after using OS X for the last 6 years but I'm really enjoying my Linux experience.

I have one thing that's bugging the hell out of me and it's how to remap keys. My hash key needs alt-shift-3 to work but the shift key always adds whitespace in whatever I'm doing. This is really difficult to use especially as I'm learning how to program. Is there anyway I could remap it from the command line or is there an app I could use to change it to the ±/§ key?

Thanks.

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: REMAP THE HASH KEY

Post by Cosmo. » Mon Jan 25, 2016 6:01 pm

The shift key does not do that usually. Do you say, that if you e.g. press in a text editor the shift key and the letter a to get A, that there is a whitespace added behind the A?

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Remap the hash key

Post by Mute Ant » Mon Jan 25, 2016 8:03 pm

"Re: Remap the hash key" It sounds so simple doesn't it? But it's the 3 key as well...you can get an idea of the scale of the problem by looking at the variants that Xorg already understands...

Code: Select all

man xkeyboard-config
...and determine your current setting with...

Code: Select all

setxkbmap -query
My People-Can-Answer-Fast reply is for you to plug in a keyboard that Xorg already knows about...or run a Virtual Keyboard for characters that don't type properly...under Accessibility perhaps?
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

dude_cor392
Level 1
Level 1
Posts: 6
Joined: Mon Jan 25, 2016 2:50 pm

Re: Remap the hash key

Post by dude_cor392 » Tue Jan 26, 2016 12:54 pm

@cosmo this is really embarrassing but I meant tab key, sorry about that mate

@Mute Ant thanks for this, I think I'm going to go with the virtual keyboard option for now until I understand the command line a bit more! I had this question on the Unix/Linux Stack Exchange forum for 3 weeks and had no reply so I appreciate the quick response :)

magnus7
Level 3
Level 3
Posts: 167
Joined: Sat Jan 30, 2016 8:46 pm

Re: Remap the hash key

Post by magnus7 » Mon Feb 01, 2016 5:51 pm

I saw your question on the Unix & Linux Stack Exchange and this is a solution.
Open gb file in text editor via terminal:

Code: Select all

gksudo gedit /usr/share/X11/xkb/symbols/gb
In preferences of text editor select the "display line numbers" option. In the file find line number 170:

Code: Select all

key <TLDE> {	[         section,       plusminus ]	};
Change it to:

Code: Select all

key <TLDE> {   [      numbersign,       plusminus ]	};
Reconfigure xkb vie terminal:

Code: Select all

sudo dpkg-reconfigure xkb-data
Restart computer.
Last edited by magnus7 on Wed Feb 08, 2017 8:38 am, edited 1 time in total.

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: Remap the hash key

Post by LinuxJim » Mon Feb 01, 2016 6:09 pm

dude_cor392 wrote:Hi guys, pretty much brand new to Linux after using OS X for the last 6 years
Just a hunch, but did you install Linux on a MacBook or MacBook Pro?

If so, did you remember to select the MacBook-specific keyboard layout at install time?

dude_cor392
Level 1
Level 1
Posts: 6
Joined: Mon Jan 25, 2016 2:50 pm

Re: Remap the hash key

Post by dude_cor392 » Tue Feb 02, 2016 7:10 pm

magnus7 wrote:I saw your question on the Unix & Linux Stack Exchange and this is a solution.
Open gb file in text editor vie terminal:

Code: Select all

sudo gedit /usr/share/X11/xkb/symbols/gb
In preferences of text editor select the "display line numbers" option. In the file find line number 170:

Code: Select all

key <TLDE> {	[         section,       plusminus ]	};
Change it to:

Code: Select all

key <TLDE> {   [      numbersign,       plusminus ]	};
Reconfigure xkb vie terminal:

Code: Select all

sudo dpkg-reconfigure xkb-data
Restart computer.

This worked! Thanks you so much dude! ######## hashes for days haha
What exactly happened when changing that code snippet? I'm really interested in learning C,C++!

magnus7
Level 3
Level 3
Posts: 167
Joined: Sat Jan 30, 2016 8:46 pm

Re: Remap the hash key

Post by magnus7 » Tue Feb 02, 2016 8:49 pm

You're welcome. It is X Keyboard Extension. If you're interested how it works search for "xkb", starting with this website: http://www.x.org/wiki/XKB/

Post Reply

Return to “Newbie Questions”