2

So as the title states I have a physical american keyboard but in Windows I am using a Swedish layout.' How do I enter the "greater/less, open/closen tag" <> character and the "pipe" | character?

user2782999
  • 121
  • 1
  • 2

5 Answers5

1

Just messed around with this. I got a mechanical keyboard with US layout for a good price and my coding ability was struck down when I saw I was missing the <>| key.

I am running Linux (Manjaro & Ubuntu) Here is how I solved it:

I made a variant of the Swedish keyboard layout and made <>| 3rd level (AltGr) from keys ,.- (se-layout... corresponding to ,./ on us-layout)

Seemed like a small enough mod and it coincides fairly well with what is printed on the physical keys on the US keyboard.

Note: For me, sudo was not good enough. Had to go su instead!

1)------ add the following to the bottom of /usr/share/X11/xkb/symbols/se

// Swedish US_keyMod
partial alphanumeric_keys
xkb_symbols "se_uskeymod" {

    include "se(basic)"

    name[Group1]="Swedish (US key-mod)";

    key <AB08> { [     comma,  semicolon, less,  dead_ogonek ] };
    key <AB09> { [    period,   colon, greater, dead_abovedot ] };
    key <AB10> { [     minus, underscore, bar, dead_abovedot ] };
};

2)------ open /usr/share/X11/xkb/rules/evdev.xml and track down where the segment is for Swedish. Find where the Swedish starts and add the following variant along with the existing ones...

<variant>
  <configItem>
    <name>se_uskeymod</name>
    <description>Swedish (US key-mod)</description>
  </configItem>
</variant>

3)------ in the file /usr/share/X11/xkb/rules/evdev.lst find the line

! variant

and look for Swedish layout variants. When you find them squeeze in the folliwing line somewhere there

se_uskeymod   se: Swedish (US key-mod)

4)------ Verify intended result with gkbd-keyboard-display -l "se(se_uskeymod)"

AltGr-mod of , . - should display < > |

5)------ Pick the modded variant of Swedish as your keyboard layout and fire away.

Optionally add SWERTY layout, available for Windows, Mac and Linux.

Zedoku
  • 11
  • 2
1

On Windows 10/11, you can solve this by installing PowerToys (link) and remapping the keys using their Keyboard Manager. Note that you will need to use the On-screen Keyboard (tutorial) in order to map to keys which are not available (such as |,<,>).

Step-by-Step:

  1. Once you've downloaded PowerToys, navigate to Keyboard Manager.
  2. Select "Remap a key", which opens the window in the bottom.
  3. Find the physical key you want to re-assign, either through the drop-down or with the Type-window. And then click the "Type" button for the "Mapped To".

Note that you cannot map a key combination, only a single key. For instance you cannot map: Ctrl+; or Alt+K.

Steps 1-3

  1. To easily map to the key that's missing from your physical keyboard use the Windows On-screen Keyboard. Simply click the key that you want your physical key to map to.

4a. If your key is missing, ensure that you are viewing the full On-screen keyboard.

enter image description here

Prezs
  • 11
  • 2
  • Avoid posting answers to old questions that already have well received answers unless you have something substantial and new to add. – Toto Feb 17 '23 at 17:43
  • 1
    Don't mind Toto, this is actually a great answer that nobody else had brought up, but more detail on the process would be fantastic – DanHolli Feb 17 '23 at 18:05
0

All three use a key found to the left of the "z" key and to the right of a half-sized shift key found on ISO 102/105 keyboards. But US Keyboards are missing it.

You can enable the On-Screen Keyboard in windows settings for those times you need to use that key. With the Swedish language enabled the on-screen keyboard will include the missing key.

See below:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

David
  • 153
  • 1
  • 6
  • Well aware of how it looks on a swedish keyboard, but I was feeling pretty stupid not finding them with the US layout, but the comments above about related threads seems to answer the question that it simply doesn't exist. – user2782999 Feb 12 '20 at 20:22
  • Yeah, doesn't exist, sorry. It's physically not there. But hopefully toggling the on-screen keyboard can save you in those cases you need to use that key, which I hope is rare. ;) – David Feb 12 '20 at 20:40
  • haha developer/sysadmin in windows platforms..... so not that rare....... – user2782999 Feb 12 '20 at 20:41
  • I worried that... being you are here. For me, because the on-screen keyboard responds to keypresses on the real keyboard, I can click just the one missing key when I need it but type all others and shift on the physical board. That's the only option short of buying an international board with the missing key. – David Feb 12 '20 at 20:57
0

The answer is that the characters does not exist using a swedish layout.

user2782999
  • 121
  • 1
  • 2
0

I have had a similar problem trying to use the UK layout setting with a US keyboard on a laptop. In my case I'm struggling to type the \ and | characters. The US keyboard does have a key with those symbols on it (next to the Enter key) but when using UK layout settings that key actually produces # and ~.

The key I'm trying to find would usually be to the left of the Z key, however this US keyboard simply has a much wider Shift key and the physical key is just missing. I won't stop to count the keys, but I assume this is the difference between a 101-key (US) layout and a 102-key layout.

HOWEVER I'm able to type the characters I want by holding down the AltGr key (the right-hand ALT key in case that's all the label shows) and then use the physical key with \ and | on it.

In order to get the | character I need to hold down the Shift key as well.

I hope that there might be a similar trick for the Swedish layout that works for you.

Charlie Joynt
  • 311
  • 2
  • 13