PowerMate_ruby is a project mainly written in Ruby, it's free.
Temporary forked project from http://www.cip.ifi.lmu.de/~bolzer/powermate/
Message-Id: [email protected] Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: improvements for PowerMate.rb From: Masatake YAMATO [email protected] To: [email protected] Cc: [email protected] Date: Thu, 11 Mar 2010 04:15:41 +0900 (JST) X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Organization: Red Hat Japan, Inc.
Hi,
Your PowerMate.rb doesn't work on x86_64 linux. I've written a patch to fix the issue based on PowerMate.rb maintained by Leigh L. Klotz, Jr. [email protected].
Look at http://graflex.org/klotz/software/griffin/ruby/. Leigh wants you to merge his improvement. Could you consider it?
diff -ruN Bolzer-0_5.rb Klotz-0_5_1.rb --- Bolzer-0_5.rb 2010-03-11 03:25:53.500799535 +0900 +++ Klotz-0_5_1.rb 2010-03-11 03:25:47.709800067 +0900 @@ -16,6 +16,14 @@ #
# +# v0.51 (October 22, 2002) +# Leigh L. Klotz, Jr. [email protected] +# The original has disappeared from +# http://www.cip.informatik.uni-muenchen.de/~bolzer/ruby/ +# and I am mirroring it at +# http://graflex.org/klotz/software/griffin/ruby +# My v0.51 adds the "powermate" id string. +#
@@ -276,8 +284,13 @@ next unless file =~ /^eventd+/ # only look at event*
begin
case self.dev_name
As I wrote, my patch is based on Leigh's code. After merging Leigh's improvement, could you merge my patch? What I've done:
Leigh, could you merge my patch if Oliver rejects mine;-P
Signed-off-by: Masatake YAMATO [email protected]
diff -ruN Klotz-0_5_1.rb Yamato-0_5_2.rb --- Klotz-0_5_1.rb 2010-03-11 03:25:47.709800067 +0900 +++ Yamato-0_5_2.rb 2010-03-11 03:39:17.150799878 +0900 @@ -114,7 +114,7 @@
# [ direction bit, type (String), number, size ]
def Ioctl.encode( array )
raise ArgumentError if array.class != Array raise ArgumentError.new( "Array has wrong number of elements, must be 4" ) if array.size != 4
array[0] << IOC_DIRSHIFT | array[1].unpack('C').first << IOC_TYPESHIFT | array[2] << IOC_NRSHIFT | array[3] << IOC_SIZESHIFT; @@ -130,7 +130,11 @@
Input_event = Struct.new( :time, :type, :code, :value )
}).call() ? 16: 24
EV_VERSION = 0x010000 @@ -297,6 +301,8 @@ break when "Griffin SoundKnob" # old ID break