You are not logged in.

#1 2012-08-09 14:39:01

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Multiple concurrent keyboard layouts

I have two keyboards, one of which does not support pressing caps lock at the same time as any other key.
For the superior keyboard I want to swap ctrl and caps lock, and for the inferior I do not want to swap and ctrl
and caps lock, but maybe some other keys.

Is there anyway to set up the keyboard layouts independently for the keyboards? I want to do this both in X and in TTY.

Offline

#2 2012-09-13 21:27:37

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: Multiple concurrent keyboard layouts

setxkbmap -help

states that you can specifies the device ID to use.
I have not tested yet, put I assume that should work.

If it works it only solved the X part, not the TTY part.

Last edited by Hibernate (2012-09-13 21:28:25)

Offline

#3 2012-09-13 22:15:10

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Multiple concurrent keyboard layouts

The console keyboard layout is called a keymap. I think you can make your own keymap and have some kind of script or daemon that listens for events (keyboard vendor "X" plugging in), and then, depending on the model, runs:

# loadkeys sv-latin1-kb1
# loadkeys sv-latin1-kb2

"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#4 2012-09-13 22:18:36

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Multiple concurrent keyboard layouts

or simply create a script that changes you layout and assign a keybinding to it


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2012-09-13 22:47:38

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Multiple concurrent keyboard layouts

Yeah, but from what I understand, he wants to swap Ctrl with Caps Lock for just one keyboard. He can only do that with a custom keymap (from the bottom of that wiki article, here: https://wiki.archlinux.org/index.php/KE … le_Keymap).

You'd only need one custom keymap, and revert to the regular one for the other keyboard. Name it something like:

# loadkeys sv-latin1-swapped
# loadkeys sv-latin1

There was a script somewhere on these forums about listening in for hot-plugging events and running a command. Search, google, etc.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB