Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
fork of Martin Kahr work on an Apple Remote Wrapper
Objective-C
branch: master

Now supports Snow Leopard.

latest commit c9aed3df0a
@bastos bastos authored committed
Failed to load latest commit information.
English.lproj port of martin's code to objc 2 and added a framework target
Japanese.lproj port of martin's code to objc 2 and added a framework target
RemoteControlWrapper.xcodeproj added readme info
.gitignore port of martin's code to objc 2 and added a framework target
AppleRemote-Info.plist
AppleRemote.bridgesupport port of martin's code to objc 2 and added a framework target
AppleRemote.h port of martin's code to objc 2 and added a framework target
AppleRemote.m Now supports Snow Leopard.
AppleRemote.tiff port of martin's code to objc 2 and added a framework target
GlobalKeyboardDevice.h
GlobalKeyboardDevice.m port of martin's code to objc 2 and added a framework target
HIDRemoteControlDevice.h port of martin's code to objc 2 and added a framework target
HIDRemoteControlDevice.m
Info.plist port of martin's code to objc 2 and added a framework target
KeyspanFrontRowControl.h
KeyspanFrontRowControl.m port of martin's code to objc 2 and added a framework target
MainController.h
MainController.m port of martin's code to objc 2 and added a framework target
MultiClickRemoteBehavior.h port of martin's code to objc 2 and added a framework target
MultiClickRemoteBehavior.m port of martin's code to objc 2 and added a framework target
RemoteControl.h port of martin's code to objc 2 and added a framework target
RemoteControl.m port of martin's code to objc 2 and added a framework target
RemoteControlClasses.graffle port of martin's code to objc 2 and added a framework target
RemoteControlContainer.h port of martin's code to objc 2 and added a framework target
RemoteControlContainer.m port of martin's code to objc 2 and added a framework target
RemoteControlWrapper_Prefix.pch port of martin's code to objc 2 and added a framework target
RemoteControls-Info.plist
RemoteFeedbackView.h port of martin's code to objc 2 and added a framework target
RemoteFeedbackView.m port of martin's code to objc 2 and added a framework target
license.txt port of martin's code to objc 2 and added a framework target
main.m port of martin's code to objc 2 and added a framework target
readme.txt added readme info

readme.txt

Remote Control Wrapper
----------------------

You can get the original version of this code from http://martinkahr.com/source-code/

Remote Control Wrapper is an Objective-C wrapper for the Apple remote control.
It was modified to be Obj-C 2 compatible and compile as a framework to be used with MacRuby.
Note that to use this framework with MacRuby you need to use a BridgeSupport file (generated for you in the repo).
A compiled version of the framework is available in the download section.

Here is a quick implementation example using MacRuby and HotCocoa:


require 'hotcocoa'
framework File.join(File.dirname(__FILE__), 'vendor', 'AppleRemote.framework')

class Application

  include HotCocoa
  
  def start
    application :name => "AppRemote" do |app|
      app.delegate = self
      window :frame => [100, 100, 500, 500], :title => "Appremote" do |win|
        win << label(:text => "Application Remote", :layout => {:start => false})
        win.will_close { exit }
      end
      @remoteControl = AppleRemote.alloc.initWithDelegate(self)
      @remoteControl.startListening(self)
    end
  end
  
  # Callback triggered when the remote is being used.
  #
  # === Parameters
  # button<Fixnum>:: button id
  # pressed<Boolean>:: is the button pressed or released
  # remote<AppleRemote>::
  def sendRemoteButtonEvent(button, pressedDown:pressed, remoteControl:remote)
    p "button pressed #{button} #{pressed ? 'clicked' : 'released'}"
  end
end
Something went wrong with that request. Please try again.