Browse Source

* Add a keymap menu.

* Allow mapping multiple locales to a single keymap.
* Update keymaps and locale-to-keymap mappings from console-keymaps-at
  2002.12.04dbs-50ubuntu2.
master
Colin Watson 17 years ago
parent
commit
08a717ecab
  1. 1
      boot.config
  2. 4
      debian/changelog
  3. 97
      dia_keymap.inc
  4. 1
      dia_lang.inc
  5. 1
      install.config
  6. 1392
      keytables.inc
  7. 11
      locale.inc
  8. 6
      panel.inc
  9. 5
      po/bg.po
  10. 5
      po/bootloader.pot
  11. 5
      po/cs.po
  12. 5
      po/da.po
  13. 5
      po/de.po
  14. 5
      po/el.po
  15. 5
      po/es.po
  16. 5
      po/fi.po
  17. 5
      po/fr.po
  18. 5
      po/gl.po
  19. 5
      po/hu.po
  20. 5
      po/it.po
  21. 5
      po/ja.po
  22. 5
      po/lt.po
  23. 5
      po/nb.po
  24. 5
      po/nl.po
  25. 5
      po/pl.po
  26. 5
      po/pt.po
  27. 5
      po/pt_BR.po
  28. 5
      po/ro.po
  29. 5
      po/ru.po
  30. 5
      po/sk.po
  31. 5
      po/sl.po
  32. 5
      po/sr.po
  33. 5
      po/sv.po
  34. 5
      po/uk.po
  35. 5
      po/zh_CN.po
  36. 5
      po/zh_TW.po
  37. 135
      scrape-console-keymaps

1
boot.config

@ -12,6 +12,7 @@
%% include xmenu.inc
%% include dia_video.inc
%% include dia_lang.inc
%% include dia_keymap.inc
%% include dia_help.inc
%% include dia_profile.inc
%% include dia_install.inc

4
debian/changelog

@ -4,6 +4,10 @@ gfxboot-theme-ubuntu (0.1.8) UNRELEASED; urgency=low
restrictions on ISO9660.
* Remove langlist from the bootlogo file and just include it on the file
system.
* Add a keymap menu.
* Allow mapping multiple locales to a single keymap.
* Update keymaps and locale-to-keymap mappings from console-keymaps-at
2002.12.04dbs-50ubuntu2.
-- Colin Watson <cjwatson@ubuntu.com> Fri, 20 Jan 2006 12:06:34 +0000

97
dia_keymap.inc

@ -0,0 +1,97 @@
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%
% Keymap selection dialog.
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/keymap.inited false def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Build keymap list.
%
% ( ) ==> ( )
%
/keymap.init {
/xmenu.keymap .xm_size array def
/xmenu xmenu.keymap def
/keymap.inited true def
xmenu .xm_current 0 put
xmenu .xm_list [ keymaps { .km.display get } forall ] put
xmenu .xm_title /txt_keymap put
% setkeymap is called by init before panel.init, so config.keymap must be
% set by now
keymap.langchanged
pmenu.init
} def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Language changed; update keymap.
%
% ( ) ==> ( )
%
/keymap.langchanged {
keymap.inited {
/keymap.tmp.cnt 0 def
keymaps {
.km.map get config.keymap eq {
xmenu.keymap .xm_current keymap.tmp.cnt put exit
} if
/keymap.tmp.cnt inc
} forall
} if
} def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Update keymap.
%
% ( ) ==> ( )
%
/keymap.update {
/xmenu xmenu.keymap def
keymaps xmenu .xm_current get get .km.locales get 0 get setkeymap
window.action actRedraw eq { pmenu.update } if
} def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Show keymap menu.
%
% ( ) => ( )
%
/panel.keymap {
"keymap" help.setcontext
window.xmenu
dup .xmenu xmenu.keymap put
dup .xmenu.update /keymap.update put
dup window.init
window.show
} def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Return width of panel entry.
%
% ( ) => ( width )
%
/panel.keymap.width {
/xmenu xmenu.keymap def
pmenu.width
} def
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Redraw panel entry.
%
% ( panel ) => ( )
%
/panel.keymap.update {
/xmenu xmenu.keymap def
pmenu.panel.update
} def

1
dia_lang.inc

@ -195,6 +195,7 @@
dup
setlang { /window.action actRedraw def } if
setkeymap
keymap.langchanged
% Why? --> see dia_install.inc; same there.
window.action actRedraw eq { pmenu.update } if

1
install.config

@ -12,6 +12,7 @@
%% include xmenu.inc
%% include dia_video.inc
%% include dia_lang.inc
%% include dia_keymap.inc
%% include dia_help.inc
%% include dia_profile.inc
%% include dia_install.inc

1392
keytables.inc
File diff suppressed because it is too large
View File

11
locale.inc

@ -39,10 +39,15 @@
/config.keymap.locale exch def
/setkeymap.found false def
keymaps {
dup .km.locale get config.keymap.locale eq {
.km.map get /config.keymap exch def exit
} { pop } ifelse
dup .km.locales get {
config.keymap.locale eq {
dup .km.map get /config.keymap exch def /setkeymap.found true def exit
} if
} forall
pop
setkeymap.found { exit } if
} forall
} def

6
panel.inc

@ -45,8 +45,10 @@
[ .panel.both [ keyF3 0 "F3" /panel.video /panel.video.width /panel.video.update /video.init ] ]
[ .panel.short [ keyF4 0 "F4" /panel.options /panel.options.width /panel.options.update .undef ] ]
[ .panel.full [ keyF4 0 "F4" /panel.keymap /panel.keymap.width /panel.keymap.update /keymap.init ] ]
is_live not {
[ .panel.full [ keyF4 0 "F4" /panel.dimode /panel.dimode.width /panel.dimode.update /dimode.init ] ]
[ .panel.full [ keyF5 0 "F5" /panel.dimode /panel.dimode.width /panel.dimode.update /dimode.init ] ]
} if
32+64bit_source {
@ -55,7 +57,7 @@
64bit_boot_dir .undef ne
32bit_boot_dir 64bit_boot_dir ne
and and {
[ .panel.full [ keyF5 0 "F5" /panel.bits /panel.bits.width /panel.bits.update /bits.init ] ]
[ .panel.full [ keyF6 0 "F6" /panel.bits /panel.bits.width /panel.bits.update /bits.init ] ]
} if
} if
} if

5
po/bg.po

@ -231,6 +231,11 @@ msgstr "Други параметри"
msgid "Language"
msgstr "Език"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/bootloader.pot

@ -196,6 +196,11 @@ msgstr ""
msgid "Language"
msgstr ""
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/cs.po

@ -231,6 +231,11 @@ msgstr "Další volby"
msgid "Language"
msgstr "Jazyk"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/da.po

@ -228,6 +228,11 @@ msgstr "Andre indstillinger"
msgid "Language"
msgstr "Sprog"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/de.po

@ -228,6 +228,11 @@ msgstr "Weitere Optionen"
msgid "Language"
msgstr "Sprache"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/el.po

@ -229,6 +229,11 @@ msgstr "Άλλες Επιλογές"
msgid "Language"
msgstr "Γλώσσα"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/es.po

@ -229,6 +229,11 @@ msgstr "Otras opciones"
msgid "Language"
msgstr "Idioma"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/fi.po

@ -228,6 +228,11 @@ msgstr "Muut valinnat"
msgid "Language"
msgstr "Kieli"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/fr.po

@ -233,6 +233,11 @@ msgstr "Autres options"
msgid "Language"
msgstr "Langue"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/gl.po

@ -203,6 +203,11 @@ msgstr "Outras opci
msgid "Language"
msgstr "Idioma"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/hu.po

@ -231,6 +231,11 @@ msgstr "Egyéb beállítások"
msgid "Language"
msgstr "Nyelv"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/it.po

@ -228,6 +228,11 @@ msgstr "Altre opzioni"
msgid "Language"
msgstr "Lingua"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/ja.po

@ -223,6 +223,11 @@ msgstr "その他のオプション"
msgid "Language"
msgstr "言語"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/lt.po

@ -225,6 +225,11 @@ msgstr "Kiti parametrai"
msgid "Language"
msgstr "Kalba"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/nb.po

@ -230,6 +230,11 @@ msgstr "Andre valg"
msgid "Language"
msgstr "Språk"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/nl.po

@ -231,6 +231,11 @@ msgstr "Andere opties"
msgid "Language"
msgstr "Taal"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/pl.po

@ -224,6 +224,11 @@ msgstr "Inne opcje"
msgid "Language"
msgstr "Język"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/pt.po

@ -228,6 +228,11 @@ msgstr "Outras Opções"
msgid "Language"
msgstr "Idioma"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/pt_BR.po

@ -224,6 +224,11 @@ msgstr "Outras Opções"
msgid "Language"
msgstr "Idioma"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/ro.po

@ -231,6 +231,11 @@ msgstr ""
msgid "Language"
msgstr ""
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/ru.po

@ -233,6 +233,11 @@ msgstr ""
msgid "Language"
msgstr ""
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/sk.po

@ -235,6 +235,11 @@ msgstr ""
msgid "Language"
msgstr ""
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/sl.po

@ -232,6 +232,11 @@ msgstr "Ostale možnosti"
msgid "Language"
msgstr "Jezik"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/sr.po

@ -225,6 +225,11 @@ msgstr "Остале опције"
msgid "Language"
msgstr "Језик"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/sv.po

@ -228,6 +228,11 @@ msgstr "Fler alternativ"
msgid "Language"
msgstr "Språk"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/uk.po

@ -233,6 +233,11 @@ msgstr ""
msgid "Language"
msgstr ""
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/zh_CN.po

@ -224,6 +224,11 @@ msgstr "其他选项"
msgid "Language"
msgstr "语言"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

5
po/zh_TW.po

@ -224,6 +224,11 @@ msgstr "其他選項"
msgid "Language"
msgstr "語言"
# label for keymap selection
#. txt_keymap
msgid "Keymap"
msgstr ""
# label for d-i mode menu
#. txt_normal_mode
msgid "Normal mode"

135
scrape-console-keymaps

@ -0,0 +1,135 @@
#! /usr/bin/perl -w
use strict;
use File::Find;
if (@ARGV != 1) {
print STDERR "Usage: $0 unpacked-console-keymaps-*-udeb\n";
exit 1;
}
my $consoledata = $ARGV[0];
my %keymaps;
open LIST, '<:utf8', "$consoledata/usr/share/console/lists/console-keymaps-at"
or die "$0: can't open $consoledata/usr/share/console/lists/console-keymaps-at";
while (<LIST>) {
chomp;
next if /^#/ or not /\S/;
my ($locales, $keymap, $keymapname) = split /\t/;
$keymapname =~ s/\s+$//;
$keymaps{$keymap} = [[split(':', $locales)], $keymapname];
}
binmode STDOUT, ':utf8';
print <<EOF;
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%
% Keyboard mappings.
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/.km.name 0 def
/.km.map 1 def
/.km.display 2 def
/.km.locales 3 def
EOF
my %pad_map = (
0x00 => 'keyIns',
0x01 => 'keyEnd',
0x02 => 'keyDown',
0x03 => 'keyPgDown',
0x04 => 'keyLeft',
0x06 => 'keyRight',
0x07 => 'keyHome',
0x08 => 'keyUp',
0x09 => 'keyPgUp',
0x10 => 'keyDel',
);
sub map_keycode ($) {
my $type = ($_[0] >> 8) & 0xff;
my $code = $_[0] & 0xff;
if ($type == 0xf0 or $type == 0xfb) {
# KT_LATIN or KT_LETTER
if ($code == 0x08 or $code == 0x7f) {
# Backspace vs. Delete is a tricky case. gfxboot understands
# both (0x08 for delete-left, keyDel for delete-right), so we
# should map 0x7f to KeyDel. Unfortunately many keymaps only
# appear to define Delete, and the situation in console-data
# seems to be quite confused. Accordingly, we just ignore both
# and let gfxboot work it out for itself, which seems to work
# better.
return '0x00';
} else {
return sprintf '0x%02x', $code;
}
} elsif ($type == 0xf3) {
# KT_PAD
return $pad_map{$code} if exists $pad_map{$code};
}
return '0x00';
}
my %keycodes;
for my $keymap (sort { $a cmp $b } keys %keymaps) {
my $file;
find(
sub {
return if defined $file;
return if not -f;
(my $name = $_) =~ s/\..*//;
$file = $File::Find::name if $name eq $keymap;
},
$consoledata
);
next unless defined $file;
my $table = `sudo loadkeys -m \Q$file\E 2>/dev/null`;
for my $map (qw(plain shift altgr)) {
if ($table =~ /${map}_map\[\] = {\s*(.*?)(?:\s|,)*}/s) {
$keycodes{$keymap}{$map} =
[map { map_keycode(hex) } split(/,\s+/, $1)];
} else {
$keycodes{$keymap}{$map} = [('0x00') x 128];
}
}
}
my %keymapfunc;
for my $keymap (sort { $a cmp $b } keys %keymaps) {
my $found = 0;
for my $index (0 .. 127) {
my $plain = $keycodes{$keymap}{plain}[$index];
my $shift = $keycodes{$keymap}{shift}[$index];
my $altgr = $keycodes{$keymap}{altgr}[$index];
if ($plain eq $keycodes{us}{plain}[$index] and
$shift eq $keycodes{us}{shift}[$index] and
$altgr eq $keycodes{us}{altgr}[$index]) {
next;
}
if (($plain ne '0x00') or ($shift ne '0x00') or ($altgr ne '0x00')) {
print "/keymap.$keymap [\n" unless $found;
$found = 1;
my $hexindex = sprintf '0x%02x', $index;
print " [ $hexindex $plain $shift $altgr ]\n";
}
}
if ($found) {
$keymapfunc{$keymap} = "keymap.$keymap";
} else {
$keymapfunc{$keymap} = '.undef';
}
print "] def\n\n" if $found;
}
print "/keymaps [\n";
for my $keymap (sort { $keymaps{$a}[1] cmp $keymaps{$b}[1] } keys %keymaps) {
my $localelist = join(' ', map(qq{"$_"}, @{$keymaps{$keymap}[0]}));
print qq{ [ "$keymap" $keymapfunc{$keymap} "$keymaps{$keymap}[1]" [ $localelist ] ]\n};
}
print "] def\n\n";
Loading…
Cancel
Save