Sha256: 935e19c429e95d66a1ddb999ce9fecb7ae24d3d63ef58f5d18af1c37571bbd7d

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

# mac-event-monitor

A Library to Monitor User Interactions

## Installation

    $ gem install mac-event-monitor

## Usage

    require 'mac-event-monitor'
    
    monitor = Mac::EventMonitor::Monitor.new

### Monitor Mouse Event

    monitor.add_listener(:mouse_down) do |event|
      puts [event.location.x, event.location.y].join(',')
    end
    monitor.run

### Monitor Keyboard Event

You need to enable "Access to assistive devices" in the Universal Access preference pane to monitor keyboard event.

    monitor.add_listener(:key_down) do |event|
      p event.keycode
      p event.shift_key?
    end
    monitor.run

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mac-event-monitor-0.2.0 README.md