I use two keyboard layouts (English and Lithuanian) and have to switch between them constantly. Windows had the shortcut ctrl+shift+alt+[symbol] that would let me type an English keyboard symbol without fully switching the keyboard layout.

E.g.: I use the "1" key to print "ą". If I want to type "!", on windows I could use ctrl+shift+alt+1. Or ctrl+alt+1 to type "1".

Is there a similar shortcut I could use in ubuntu?

  • I believe you are looking to use the 'compose key' - some details can be found here – Charles Green Nov 22 '17 at 16:23
  • 1
    @CharlesGreen: Nope. The OP just needs to know how to make use of <AltGr>. Please see my answer. – Gunnar Hjalmarsson Nov 22 '17 at 17:07
  • @GunnarHjalmarsson Perhaps I'm mistaken, but isn't <AltGr> the compose key? – Charles Green Nov 22 '17 at 17:08
  • 2
    @CharlesGreen: By default there is no dedicated compose key. Many (most) keyboard layouts, e.g. the Lithuanian one, reserves <AltGr> (or <Right Alt>) for accessing third and fourth level key symbols. And when working like that, it's not called "compose key". – Gunnar Hjalmarsson Nov 22 '17 at 17:14
  • 1
    @CharlesGreen: If it's defined as <Right Alt> for you, you must have picked <Right Alt> as the compose key previously. By default the compose key is disabled. (Otherwise there is a bug...) Let me guess: You use the English US layout, which does not make use of 3:rd and 4:th level symbols. In that case it makes a lot of sense to use <Right Alt> as the compose key. For most other keyboard layouts, <Right Alt> is a pretty bad compose key choice. – Gunnar Hjalmarsson Nov 22 '17 at 17:27
up vote 1 down vote accepted

Well, you can't type symbols from other layouts, but there is indeed an equivalent to access symbols which are actually part of the Lithuanian layout.

To type 1 with the Lithuanian keyboard layout:

AltGr+1

To better understand how the Lithuanian layout on Linux works: When Lithuanian is selected, click the layout indicator at the top right of the screen and select the Show keyboard layout option. That will show an image of the Lithuanian layout. Let's take the 1 key as an example: enter image description here

That tells us:

  1. 1 -> ą
  2. Shift+1 -> Ą
  3. AltGr+1 -> 1
  4. Shift+AltGr+1 -> !

HTH

  • I actually never knew about the altGr key... It was there but I never knew what it was for as ctrl+alt essentially did the same thing for me. Thank you for the help! – Edvinas Šulcas Nov 23 '17 at 10:28
  • “Well, you can't type symbols from other layouts, …”—You can. There is ISO_Group_Shift which can be used to “shift” to the next layout. That can be used to switch to the layout if you have set up the layouts with e.g. setxkbmap "us,fr" (assuming the layouts have the ISO_Group_Shift keys; I think the Japanese layouts have for one). – Guildenstern Nov 24 '17 at 13:08
  • @Guildenstern: Maybe I'm missing something, but.. I didn't mean to say that you can't switch layout. The default shortcut in Ubuntu for doing so is <Super>+<Space>. The above question was about how to avoid that. – Gunnar Hjalmarsson Nov 24 '17 at 13:53
  • @GunnarHjalmarsson the key that I mentioned functions as a shift key so it doesn’t function as Super+Space. It doesn’t switch the layout, only “shifts” to the next layout while pressed. – Guildenstern Nov 24 '17 at 14:08
  • 1
    @Guildenstern: Thanks for explaining; I've not stumbled upon that feature yet. – Gunnar Hjalmarsson Nov 24 '17 at 14:38

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.