Making CAPS LOCK another CTRL key in the console

2011-01-03 Thread Bernie Innocenti
In Debian & Ubuntu, this can be done by setting XKBOPTIONS=ctrl:nocaps
in /etc/default/console-setup.

A program called ckbcomp compiles a keymap file which contains this
line:

 keycode 58 = Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control Control Control Control Control Control Control 
Control Control Control Control 
 Control Control Control Control Control Control

(yes, really this redundant :)

So, what's the moral equivalent of this in Fedora?

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs   - http://sugarlabs.org/

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: Making CAPS LOCK another CTRL key in the console

2011-01-03 Thread Stephen John Smoogen
On Mon, Jan 3, 2011 at 15:20, Bernie Innocenti  wrote:
> In Debian & Ubuntu, this can be done by setting XKBOPTIONS=ctrl:nocaps
> in /etc/default/console-setup.
>
> A program called ckbcomp compiles a keymap file which contains this
> line:
>
>  keycode 58 = Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control Control Control Control 
> Control Control Control Control Control Control
>  Control Control Control Control Control Control
>
> (yes, really this redundant :)


Several. The gnome utility for keyboard can map Capslock to Control
(as god/Sun intended). Or I use the following:
#!/bin/sh
xmodmap - < So, what's the moral equivalent of this in Fedora?
>
> --
>   // Bernie Innocenti - http://codewiz.org/
>  \X/  Sugar Labs       - http://sugarlabs.org/
>
> --
> devel mailing list
> devel@lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
>



-- 
Stephen J Smoogen.
"The core skill of innovators is error recovery, not failure avoidance."
Randy Nelson, President of Pixar University.
"Let us be kind, one to another, for most of us are fighting a hard
battle." -- Ian MacLaren
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: Making CAPS LOCK another CTRL key in the console

2011-01-04 Thread Richard W.M. Jones
On Mon, Jan 03, 2011 at 03:47:25PM -0700, Stephen John Smoogen wrote:
> The gnome utility for keyboard can map Capslock to Control (as
> god/Sun intended).

Does this really work for anyone else?

I tried fiddling with Keyboard Preferences -> Layouts -> Options ->
{Caps Lock key behaviour, Ctrl key position} but no combination seemed
to do what it claimed.  Caps Lock key on my Lenovo keyboard is
resolutely enabled whatever I do.  Do I have to restart X?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: Making CAPS LOCK another CTRL key in the console

2011-01-04 Thread Gabriel L. Somlo
I personally use 

setxkbmap -option ctrl:swapcaps

However, I believe the OP was asking about whether it's possible to
swap Control and CapsLock for the console, outside/before X, so that
the change is available system-wide, regardless of which virtual
console one happens to be using at the time.

I'm interested too, because my 'setxkbmap' based approach fails in
interesting ways when using VMs in virt-manager: e.g., pushing control
counts as control inside the VM, but turns on caps lock within my
desktop's X session, and so on.

Thanks,
--G

On Mon, 3 Jan 2011 at 15:47,  wrote:
> On Mon, Jan 3, 2011 at 15:20, Bernie Innocenti  wrote:
> > In Debian & Ubuntu, this can be done by setting XKBOPTIONS=ctrl:nocaps
> > in /etc/default/console-setup.

...
 
> Several. The gnome utility for keyboard can map Capslock to Control
> (as god/Sun intended). Or I use the following:
> #!/bin/sh
> xmodmap - < !
> ! Swap Caps_Lock and Control_L
> !
> remove Lock = Caps_Lock
> remove Control = Control_L
> keysym Control_L = Caps_Lock
> keysym Caps_Lock = Control_L
> add Lock = Caps_Lock
> add Control = Control_L
> keycode 22 = BackSpace
> keycode 107 = Delete
> EOF
> 
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: Making CAPS LOCK another CTRL key in the console

2011-01-04 Thread Nicolas Mailhot
Keyboard layout definitions are hell to maintain. There are too many locales,
and most of them are not finished yet unicode side (aside from the continuous
monetary symbol churn, even "big" "simple" latin languages like German had
changes in the recent years).

Therefore, the only sustainable solution would be to centralise layout
definitions in a single authoritative database. This has been done X-side with
xkeyboard-config, but the console needs to be taught to use those definitions
too.

Unfortunately, Fedora still uses a separate layout database for the console
(IIRC Debian/Ubuntu translate xkeyboard-config layout definitions to console
layout definitions, which is worse than reading xkeyboard-config directly but
loads better than what Fedora does). This causes all sorts of problems,
requiring a table of console/x layout correspondances, which is perpetually
out-of-sync and incomplete (not all xkeyboard-config definitions have a
console correspondance).

-- 
Nicolas Mailhot

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: Making CAPS LOCK another CTRL key in the console

2011-01-04 Thread Todd Zullinger
Bernie Innocenti wrote:
> In Debian & Ubuntu, this can be done by setting XKBOPTIONS=ctrl:nocaps
> in /etc/default/console-setup.
[...]
> So, what's the moral equivalent of this in Fedora?

I have something like this in my puppet configuration:

zcat /lib/kbd/keymaps/i386/qwerty/us.map.gz | \
sed 's/^\(keycode *58 = \)Caps_Lock$/\1Control/' > \
/etc/sysconfig/console/default.kmap

-- 
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
He was busy creating hell for people who ask such questions.
-- St. Augustin, in reply to "What was God doing before creation?



pgp2sTWuMklSD.pgp
Description: PGP signature
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: Making CAPS LOCK another CTRL key in the console

2011-01-04 Thread Peter Hutterer
On Tue, 4 Jan 2011 08:49:05 -0500, "Gabriel L. Somlo"  wrote:
> I personally use 
> 
>   setxkbmap -option ctrl:swapcaps
> 
> However, I believe the OP was asking about whether it's possible to
> swap Control and CapsLock for the console, outside/before X, so that
> the change is available system-wide, regardless of which virtual
> console one happens to be using at the time.
> 
> I'm interested too, because my 'setxkbmap' based approach fails in
> interesting ways when using VMs in virt-manager: e.g., pushing control
> counts as control inside the VM, but turns on caps lock within my
> desktop's X session, and so on.

xkb is nasty for nested setups because while the vast majority of work
is done in the client, some parts of it are done in the server.

events are keycode-only and it's the client's responsibility to
translate this into a meaningful glyph, based on the keymap. e.g. if the
host is on qwerty and the client on azerty, both still receive the same
keycodes but produce different glyphs.

certain xkb actions such as setting modifiers, changing groups and
toggling leds are based on the local keymap but happen in the server. in
your case, if you setxkbmap in the client this doesn't change the host's
keymap, so the host still assumes caps is CapsLock, not Control_L and
hence toggles the leds. the only way around this is to always sync the
keymaps by running the same command in the host and the client.

Cheers,
  Peter
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel