4

Basic keyboard layout:

  • 11
  • Shift+1!

I would like: Ctrl+1¹. (Superscript one character). The following code allows me to type ¹, but only with Shift+1:

xmodmap -e "keycode  10 = 1 onesuperior"

Conclusively, I would like to keep Shift+1 for ! and Ctrl+1 for ¹.

3
  • 1
    Apparently not without losing Ctrl as ctrl: superuser.com/q/443050/334516
    – muru
    Jun 1, 2015 at 20:05
  • 1
    Are you looking to map specific keys or Right CTRL key as AltGr lvl3 shift where Left CTRL as standard CTRL modifier?
    – user.dz
    Jun 2, 2015 at 10:49
  • 1
    I do know how to map different keys, I do want to use ctrl as a modifier, but want to keep it as ctrl. However, looking at both your answers, it appears that that may be my only choice in the end.
    – TuxForLife
    Jun 2, 2015 at 22:19

2 Answers 2

2
+50
  • This seems to me very related to:

    How do I assign a keyboard shortcut that uses AltGr as a modifier key?

    Keep Right Alt or AltGr as ISO_Level3_Shift and try to use it as Alt Modifier too.

    Where in your case is reverse: Keep Right Ctrl or Left Ctrl as Control Modifier and an extend it to be used a Level Shift.

  • I couldn't get it to work in both functions, one trial was by adding actions: (Doesn't work)

    key <RCTL> {
             type= "ONE_LEVEL",
             symbols[Group1]= [ ISO_Level5_Shift ],
             actions[Group1]= [ SetMods(modifiers=Control) ]
    };
    

    from xkb - problems using virtual keys and ISO_Level3_Shift key but it just works one way only.

    Possibly, someone knowing XKB very well can make such setup.

  • One setup that works for me: (no key repeat)

    1. Install and setup xbindkeys & xautomation as in How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?)
    2. Add this lines to ~/.xbindkeysrc

      "usleep 150000; xte 'keyup Control_L' 'str ¹' 'keydown Control_L'"
        m:0x4 + c:10
        control + 1
      

      For me, I have ¹ with AlgGr. So I could use this too:

      "usleep 150000; xte 'keyup Control_L' 'keydown ISO_Level3_Shift' 'key 1' 'keyup ISO_Level3_Shift' 'keydown Control_L'"
      
    3. Restart xbindkeys daemon

      pkill xbindkeys;xbindkeys
      
0

You can use xev command and then push Ctrl key, then see the keycode, for example mine is "keycode 37" for Ctrl.

However I didn't think superscript will work in editor nor terminal/console and anything except word processor. Superscript and subscript exist in word editor (LibreOffice, Ms Word, etc) but, for example, in Latex we use underscore "_" for subscript and ^ for superscript.

You must log in to answer this question.

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