[30378] distfiles
source_changes at macosforge.org
source_changes at macosforge.org
Thu Oct 25 20:31:00 PDT 2007
Revision: 30378
http://trac.macosforge.org/projects/macports/changeset/30378
Author: yves at macports.org
Date: 2007-10-25 20:31:00 -0700 (Thu, 25 Oct 2007)
Log Message:
-----------
move from yves
Added Paths:
-----------
distfiles/remap-bad-apple-keys/
distfiles/remap-bad-apple-keys/remap-bad-apple-keys-1.0.pl
Added: distfiles/remap-bad-apple-keys/remap-bad-apple-keys-1.0.pl
===================================================================
--- distfiles/remap-bad-apple-keys/remap-bad-apple-keys-1.0.pl (rev 0)
+++ distfiles/remap-bad-apple-keys/remap-bad-apple-keys-1.0.pl 2007-10-26 03:31:00 UTC (rev 30378)
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+my $VERSION = '1.0';
+
+my @keys = ('Up', 'Down', 'Left', 'Right');
+
+open (XMODMAP, "xmodmap -pk |") or die "couldn't run xmodmap -pk: $!\n";
+
+while (my $line = <XMODMAP>) {
+ chomp($line);
+ $line =~ s/^\s*(.*?)\s*$/$1/;
+ my ($keycode, @values) = split(/[ ]+/, $line);
+
+ for my $index (0..$#values) {
+ $values[$index] =~ s/^\((.*)\)$/$1/;
+ }
+
+ my @primary = (shift @values, shift @values);
+
+ for my $key (@keys) {
+ if ($primary[1] eq $key) {
+ my @command = ('xmodmap', '-e', "keycode $keycode = $key");
+ print join(', ', @command), "\n" if (@ARGV);
+ system(@command);
+ }
+ }
+
+}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071025/92d1f8a4/attachment-0001.html
More information about the macports-changes
mailing list