5

I would like to type some specific characters after using xmodmap to map them.

For example, the ⅒ character (Numeric value: 0x2152).

I would like to change a keyboard button to type ⅒ like so

xmodmap -e "keycode 56 = 0x2152"    #Would like it to type "⅒"

However, this does not work. An example using the pound sign works:

xmodmap -e "keycode 56 = 0x023"     #Types "#"

Is there anything I can do to get this to work, or who can I contact to get this to work?

2
  • Interestingly, I see a square here, but if I paste the character into another program, I see the 1/10 sign. What is the actual character?
    – Spotlight
    Mar 27, 2015 at 3:00
  • 1
    It is indeed the 1/10 sign. Maybe your browser is using a font that does not support such character?
    – TuxForLife
    Mar 27, 2015 at 6:06

2 Answers 2

9

xmodmap -e "keycode 61 = U2152" # ⅒

Works for me.

Like ByteCommander said already the U stands for Unicode. More Information are available in the man page of xmodmap.

3
  • Although the answer solved the question, you could still improve it a bit (and keep in mind for future answers) by adding some explanations or detail about what you suggest. I don't know if this is correct here, but you could have written for example that the "U" is needed before the character code to tell xmodmap it is a Unicode character (just guessing).
    – Byte Commander
    Mar 26, 2015 at 19:26
  • @ByteCommander: You are right guessing the U stands for Unicode. I Updated the answer. Mar 27, 2015 at 12:50
  • Unicodes are usually displayed as U+2152, which is what I tried, but it didn't work. So taking out the plus is the solution.
    – TuxForLife
    Mar 27, 2015 at 17:49
2

And once you used the correct answer by juAron, Are you sure you have a font for it? With a Compose Key, I can type it for example in LO writer eith the Libertine font as Compose 1 10:

LO output

...but it will not work on the terminal:

on terminal

Unless I use the correct font (Notice this is a big character, it makes strange things on monospaced fonts:)

enter image description here

(PD: xmodmap is deprecated; see here for more details).

1
  • Yes, I did have a working font for it, after using juAron's command, it worked. Thank you either way!
    – TuxForLife
    Mar 26, 2015 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .