[26231] distfiles/yves

source_changes at macosforge.org source_changes at macosforge.org
Sat Jun 16 05:52:05 PDT 2007


Revision: 26231
          http://trac.macosforge.org/projects/macports/changeset/26231
Author:   yves at macports.org
Date:     2007-06-16 05:52:04 -0700 (Sat, 16 Jun 2007)

Log Message:
-----------
2 new improbale ditfiles

Added Paths:
-----------
    distfiles/yves/org.opendarwin.keymaps-7.2.1-1.tgz
    distfiles/yves/remap-bad-apple-keys-1.0.pl

Added: distfiles/yves/org.opendarwin.keymaps-7.2.1-1.tgz
===================================================================
(Binary files differ)


Property changes on: distfiles/yves/org.opendarwin.keymaps-7.2.1-1.tgz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: distfiles/yves/remap-bad-apple-keys-1.0.pl
===================================================================
--- distfiles/yves/remap-bad-apple-keys-1.0.pl	                        (rev 0)
+++ distfiles/yves/remap-bad-apple-keys-1.0.pl	2007-06-16 12:52:04 UTC (rev 26231)
@@ -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/20070616/d5aa15b1/attachment.html


More information about the macports-changes mailing list