Class: WiiMote

Inherits:
Object
  • Object
show all
Defined in:
lib/cwiid_ext.rb

Overview

ruby-cwiid - Wii Remote interface for Ruby. Copyright © 2010 Jan Wedekind

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newObject



22
23
24
25
26
# File 'lib/cwiid_ext.rb', line 22

def new
  retval = orig_new
  retval.rpt_mode = RPT_STATUS | RPT_BTN | RPT_ACC | RPT_IR
  retval
end

.orig_newObject



20
# File 'lib/cwiid_ext.rb', line 20

alias_method :orig_new, :new

Instance Method Details

#batteryObject



32
33
34
# File 'lib/cwiid_ext.rb', line 32

def battery
  orig_battery.to_f / BATTERY_MAX
end

#orig_batteryObject



30
# File 'lib/cwiid_ext.rb', line 30

alias_method :orig_battery, :battery