Class: ProconBypassMan::Procon::ButtonCollection
- Inherits:
-
Object
- Object
- ProconBypassMan::Procon::ButtonCollection
- Defined in:
- lib/procon_bypass_man/procon/button_collection.rb
Constant Summary collapse
- BYTES_MAP =
https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/ac8093c84194b3232acb675ac1accce9bcb456a3/bluetooth_hid_notes.md 0) Input report ID
- Timer. Increments very fast. Can be used to estimate excess Bluetooth latency. 2 high nibble) Battery level. 8=full, 6=medium, 4=low, 2=critical, 0=empty. LSB=Charging. 2 low nibble) Connection info. (con_info >> 1) & 3 - 3=JC, 0=Pro/ChrGrip. con_info & 1 - 1=Switch/USB powered.
- ZR R SR(right) SL(right) A B X Y
- Grip (none) Cap Home ThumbL ThumbR + -
- ZL L SL(left) SR(left) Left Right Up Down
- analog Left analog stick data
- analog Left analog stick data
- analog Left analog stick data
- analog Right analog stick data a) analog Right analog stick data b) analog Right analog stick data
{ 0 => nil, 1 => nil, 2 => nil, 3 => [:zr, :r, :sr, :sl, :a, :b, :x, :y], 4 => [:grip, :_undefined_key, :cap, :home, :thumbl, :thumbr, :plus, :minus], 5 => [:zl, :l, :sl, :sr, :left, :right, :up, :down], 6 => [], 7 => [], 8 => [], }.freeze
- BUTTONS_MAP =
BYTES_MAP.reduce({}) { |acc, value| next acc if value[1].nil? value[1].reverse.each.with_index do |, index| next(acc) if == :grip || == :_undefined_key acc[] = { byte_position: value[0], bit_position: index } end acc }.freeze
- BUTTONS =
ProconBypassMan::Procon::ButtonCollection::BUTTONS_MAP.keys.freeze
- LEFT_ANALOG_STICK =
{ byte_position: 6..8 }
Class Method Summary collapse
Class Method Details
.available ⇒ Array<Symbol>
42 43 44 |
# File 'lib/procon_bypass_man/procon/button_collection.rb', line 42 def self.available BUTTONS end |