• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Controllers v
« Previous 1 ... 126 127 128 129 130 ... 320 Next »

FreePIE
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
FreePIE
12-14-2015, 06:08 PM (This post was last modified: 12-14-2015, 06:10 PM by clairane.)
#1
clairane Offline
Junior Member
**
Posts: 16
Threads: 5
Joined: Nov 2015
I'm using FreePIE as an alternative GlovePIE for my Wiimote+Nunchuck everything works fine with the following script but the analog stick is being treated like rapid fire instead of single touches, in notepad it shows up as

IIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJJJJJJJJJJJKKKKKKKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLL instead of just IJKL.

Any help guys do i need to add anything extra like deadzones or timing interval?

Code:
def analogStick():
   if wiimote[0].nunchuck.stick.y > 40:
      keyboard.setPressed(Key.I)
   if wiimote[0].nunchuck.stick.y < -40:
      keyboard.setPressed(Key.K)
   if wiimote[0].nunchuck.stick.x > 40:
      keyboard.setPressed(Key.L)
   if wiimote[0].nunchuck.stick.x < -40:
      keyboard.setPressed(Key.J)

def map_wiimote_to_key(wiimote_index, wiimote_button, key):
    # Check the global wiimote object's button state and set the global
    # keyboard object's corresponding key.
    if wiimote[wiimote_index].buttons.button_down(wiimote_button):
        keyboard.setKeyDown(key)
    else:
        keyboard.setKeyUp(key)
        
def map_nunchuck_to_key(wiimote_index, wiimote_button, key):
    # Check the global nunchuck object's button state and set the global
    # keyboard object's corresponding key.
    if wiimote[wiimote_index].nunchuck.buttons.button_down(wiimote_button):
        keyboard.setKeyDown(key)
    else:
        keyboard.setKeyUp(key)
        
def update():
    # Sideways controls (DPad). Map each of our desired keys.
    map_wiimote_to_key(0, WiimoteButtons.DPadRight, Key.D)
    map_wiimote_to_key(0, WiimoteButtons.DPadLeft, Key.A)
    map_wiimote_to_key(0, WiimoteButtons.DPadUp, Key.W)
    map_wiimote_to_key(0, WiimoteButtons.DPadDown, Key.S)
    
    # 1 button --> 1 key
    map_wiimote_to_key(0, WiimoteButtons.One, Key.D1)
    # 2 button --> 2 key
    map_wiimote_to_key(0, WiimoteButtons.Two, Key.D2)
    
    # - button --> - key
    map_wiimote_to_key(0, WiimoteButtons.Minus, Key.Minus)
    # + button --> + key
    map_wiimote_to_key(0, WiimoteButtons.Plus, Key.NumberPadPlus)
    
    # A button --> X key
    map_wiimote_to_key(0, WiimoteButtons.A, Key.X)
    # B button --> B key
    map_wiimote_to_key(0, WiimoteButtons.B, Key.B)
    
    # Home button --> Return key
    map_wiimote_to_key(0, WiimoteButtons.Home, Key.Return)
    
    #nunchuck
    map_nunchuck_to_key(0, NunchuckButtons.C, Key.C)
    map_nunchuck_to_key(0, NunchuckButtons.Z, Key.Z)
    
# If we're starting up, then hook up our update function.
if starting:
    global previous
    previous = False
    wiimote[0].nunchuck.update += analogStick
    wiimote[0].buttons.update += update
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode