Announcement

Collapse
No announcement yet.

How do I enter unicode character using the keyboard

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I enter unicode character using the keyboard

    Hi,

    I have read that I could enter any unicode character by typing
    Ctrl+Shift+u code <blank>
    where
    code
    is eg e5 for an å.
    However, I have found that this does not work on my kubuntu 20.04. Instead nothing happens on
    Ctrl+Shift+u
    and then the
    e5
    is shown.
    I tried this in kate (where I would like to use this feature to enter bullets or arrows) and also in konsole (tried just for testing).

    How can I configure this feature?

    Thanks in advance,
    Josef

    #2
    See this: https://userbase.kde.org/Tutorials/ComposeKey
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      I know you want a keyboard-based solution and the Compose key route provides that. I have limited use for extended characters, but for the few I use, I have a plain text file containing these characters. I have a script (bound to a convenient keyboard shortcut) that (or which?) uses Rofi plus xclip plus xdotool (so X11 only) to select the relevant character and paste it into a qt/gtk application. (I don't need to use extended characters in any terminal including my PS1 prompt.)

      The script:


      Code:
      #!/bin/bash
      
      options='-columns 6 -width 100 -lines 20 -location 1'
      
      selected=$( < $HOME/Dropbox/bin/my-special-chars.txt rofi -dmenu -i -markup-rows -columns 6 -width 50 -lines 20 -location 1 -p "Select item: " )
      
      [[ -z $selected ]] && exit
      
      echo -ne $(echo "$selected" | awk ' { print $1 } ')\
      | xclip -selection clipboard
      sleep 0.1
      xdotool key shift+Insert
      
      exit 0
      And my-specialchars.txt (I don't know how they'll show up here!):

      ✔ right 237B
      ✘ wrong 2718
      » greater 00BB
      « less 00AB
      … ellipsis 2026
      ™ trademark 2122
      © copyright 00A9
      ® registered 00AE
      ° degree 00B0
      • big-dot 2022
      ⚙ cog wheel/gear 2699
      😃 smile 1F603
      😉 wink 1F609
      😔 sad 1F614
      ☰ hamburger 2630
      — em-dash 2014
      ① circle-1 2460
      ② circle-2 2461
      ③ circle-3 2462
      ¹ super-1 00B9
      ² super-2 00B2
      ³ super-3 00B3
      ⁴ super-4 2074
      ⁵ super-5 2075
      ⁶ super-6 2076
      ⁷ super-7 2077
      ⁸ super-8 2078
      ⁹ super-9 2079
      ± plus/minus 00B1
      µ mu 03BC
      α alpha 03B1
      β beta 03B2
      λ lambda 03BB
      ¶ pilcrow 00B6
      Δ delta-cap 0394
      Σ sigma-cap 03A3
      BTW, with a little modification, the script works in Wayland (with Sway).
      Last edited by chimak111; Feb 09, 2022, 07:39 PM.
      Kubuntu 20.04

      Comment


        #4
        Check this out:
        man scankeycodes

        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Originally posted by jmoellers View Post
          I have read that I could enter any unicode character by typing
          where is eg e5 for an å.
          However, I have found that this does not work on my kubuntu 20.04.
          It is working for me in 21.10.

          I've mucked about a lot with keyboard layouts and system settings, input devices, keyboard, advanced tab, but I don't know what turned this on. (I usually use a compose key, set to the pause key, for several symbols and diacritics, and i_ctrl-v in vim if I'm desperate.)

          Edit - Maybe I mucked about with Input Methods. On the plasma Settings menu I have two items called "Input Method" and another "IBUS Preferences".
          Last edited by jlittle; Feb 10, 2022, 05:39 PM.
          Regards, John Little

          Comment


            #6
            I don't use Wayland.

            I just started my test jammy install, and control-shift u didn't work. I used muon to install "ibus" (on the suggestion of the "Input Method" dialogue). By itself, that wasn't enough, but using "Input Method" again I chose "activate Intelligent Input Bus (IBus) @", log out, and back in and ctrl-shift-u to enter Unicode points by hex code works.

            What the consequences of doing this are, or any downsides, I've no idea.

            If there's some code point I want to enter occasionally that isn't covered by the standard compose key stuff, I think I'd try to add my point to the compose key set up, though the last time I tried I failed. (I need to enter Δ and μ for my work, so I use the EuroKey keyboard layout, which has a dead-greek key.)
            Regards, John Little

            Comment


            • Qqmike
              Qqmike commented
              Editing a comment
              Would you happen to be a mathematician, or math-guy, jlittle?

            • jlittle
              jlittle commented
              Editing a comment
              (Not sure how to reply to a comment.)
              No, I work with building analytics software, which is very picky about units. For example, subtracting temperatures gives a distinct unit, typically Δ°C; an exception is thrown, with an obnoxiously long stack trace, comparing Δ°C with °C, or adding two temperatures.
          Working...
          X