summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-28 16:38:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-28 16:38:57 +0000
commita5be3a7fffa550e22e2a56ee40151b69c00afe8a (patch)
treee9bf4c3d1deb3d516518a667747c6595482682b7 /perl-install
parent03a6ac1b1e4a542a73f0f57e61333fd17664e969 (diff)
downloaddrakx-a5be3a7fffa550e22e2a56ee40151b69c00afe8a.tar
drakx-a5be3a7fffa550e22e2a56ee40151b69c00afe8a.tar.gz
drakx-a5be3a7fffa550e22e2a56ee40151b69c00afe8a.tar.bz2
drakx-a5be3a7fffa550e22e2a56ee40151b69c00afe8a.tar.xz
drakx-a5be3a7fffa550e22e2a56ee40151b69c00afe8a.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/share/keymaps.tar.bz2bin0 -> 10879 bytes
-rwxr-xr-xperl-install/share/keymaps_generate17
-rwxr-xr-xperl-install/share/kmap2bkmap37
3 files changed, 54 insertions, 0 deletions
diff --git a/perl-install/share/keymaps.tar.bz2 b/perl-install/share/keymaps.tar.bz2
new file mode 100644
index 000000000..c5d5177cc
--- /dev/null
+++ b/perl-install/share/keymaps.tar.bz2
Binary files differ
diff --git a/perl-install/share/keymaps_generate b/perl-install/share/keymaps_generate
new file mode 100755
index 000000000..29fd576fb
--- /dev/null
+++ b/perl-install/share/keymaps_generate
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use lib "..";
+use keyboard;
+
+system("rm -rf keymaps ; mkdir keymaps");
+
+foreach (keyboard::xmodmaps()) {
+ my $kmap = keyboard::keyboard2kmap($_);
+ if (system("./kmap2bkmap $kmap > keymaps/$kmap.bkmap 2>/dev/null") != 0) {
+ warn "unknown kmap $kmap\n";
+ unlink "keymaps/$kmap.bkmap";
+ }
+}
+
+system("tar cfI keymaps.tar.bz2 keymaps") == 0 or die;
+system("rm -rf keymaps");
diff --git a/perl-install/share/kmap2bkmap b/perl-install/share/kmap2bkmap
new file mode 100755
index 000000000..3aff35c3e
--- /dev/null
+++ b/perl-install/share/kmap2bkmap
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+
+use lib "..";
+use c;
+
+my $KMAP_MAGIC = 0x8B39C07F;
+
+BEGIN { @ARGV == 1 or die "usage: kmap2bkmap <keymap>\n" }
+
+system("sudo loadkeys $ARGV[0]") == 0 or die;
+open F, "dumpkeys -n -f |";
+<F> =~ /^keymaps\s+(.*)/ or die;
+foreach (split ',', $1) {
+ my @l = /(\d+)-(\d+)/;
+ my ($i, $j) = @l ? @l : ($_,$_);
+ $keymaps[$_] = 1 foreach $i .. $j;
+}
+
+print pack("I", $KMAP_MAGIC);
+print map { pack "i", $keymaps[$_] || 0 } 0 .. c::MAX_NR_KEYMAPS()-1;
+
+foreach (<F>) {
+ s/\+0x/0x/g;
+ my ($keycode, $key, undef, @l) = split;
+ $keycode eq 'keycode' or next;
+ my $i = 0;
+ $L[$i++][$key] = hex $_ foreach @l;
+}
+close F or die "dumpkeys failed";
+
+foreach (@L) {
+ foreach my $i (0 .. c::NR_KEYS()-1) {
+ print pack "s", defined $_->[$i] ? $_->[$i] : 0x200;
+ }
+}
+
+exit 0;