Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

`loadkeys' with `--console' option

31 views
Skip to first unread message

Emanuel Berg

unread,
May 19, 2013, 5:14:42 PM5/19/13
to
I'm not getting it to work. If I read the man page correctly, with the
`--console' option you can confine the changes to a certain Linux
VT. But there isn't an example... If I provide (for example)
"/dev/tty2" it works, but it is not confined. "/dev/vcs[a]2", whatever
that is, doesn't work (`loadkeys' says can't open).
--
Emanuel Berg - programmer (hire me! CV below)
computer projects: http://user.it.uu.se/~embe8573
internet activity: http://home.student.uu.se/embe8573

Alan Curry

unread,
May 19, 2013, 9:29:37 PM5/19/13
to
In article <87vc6ez...@VLAN-3434.student.uu.se>,
Emanuel Berg <embe...@student.uu.se> wrote:
>I'm not getting it to work. If I read the man page correctly, with the
>`--console' option you can confine the changes to a certain Linux
>VT. But there isn't an example... If I provide (for example)
>"/dev/tty2" it works, but it is not confined. "/dev/vcs[a]2", whatever
>that is, doesn't work (`loadkeys' says can't open).

The man page doesn't explain this properly... the version I have seems to end
abruptly in the middle of a sentence.

All VT's attached to the same keyboard share the same keymap, which is stored
at a much lower layer than the tty, way down at the input layer.

loadkeys will try to find a console device that it can open, but if you're
running it inside a screen session on tty5 and don't have sufficient
privileges to open /dev/console, /dev/tty0, or any other magic devices, you
might have to give it some help by specifying --console /dev/tty5.

It won't enable you to do what you apparently want, which is to have your
keymap automatically change when you switch from tty1 to tty2 with Alt+F2.
If you explain your overall goal, maybe we can find a better way to get it
done.

--
Alan Curry

Emanuel Berg

unread,
May 19, 2013, 10:25:17 PM5/19/13
to
pac...@kosh.dhis.org (Alan Curry) writes:

> It won't enable you to do what you apparently want, which is to have
> your keymap automatically change when you switch from tty1 to tty2
> with Alt+F2. If you explain your overall goal, maybe we can find a
> better way to get it done.

I've rebind the Alt-F2 solution (as to not have to reach for the F2
key), but other than that, you're right on.

In a file that is read in rc.local with loadkeys, I setup scrolling in
a tty with Alt-P and Alt-N:

### scrolling

## P (up)
alt keycode 25 = Scroll_Backward
ctrll alt keycode 25 = Scroll_Backward

## N (down)
alt keycode 49 = Scroll_Forward
ctrll alt keycode 49 = Scroll_Forward

Now, really, I like to do this with *Control* and not Alt). But, if I
set it up that way, I can't use C-p and C-n in Emacs (previous-line,
next-line), or the same shortcuts in irssi, because Emacs and irssi
are in ttys as well.
0 new messages