name
getCoolieHat ( )
import processing.opengl.*;

import procontroll.*;
import net.java.games.input.*;

ControllIO controllIO;
ControllDevice joypad;
ControllCoolieHat cooliehat;

float transX;
float transY;

void setup(){
  size(600,600,OPENGL);

  transX = width/2;
  transY = height/2;

  controllIO = ControllIO.getInstance(this);

  joypad = controllIO.getDevice("Logitech RumblePad 2 USB");
  joypad.printButtons();

  cooliehat = joypad.getCoolieHat(0);
  cooliehat.setMultiplier(4);
}

void handleButton1Press(){
  fill(255,0,0);
  joypad.rumble(1);
}

void draw(){
  transX += cooliehat.getX();
  transY += cooliehat.getY();
  
  background(0);
  lights();
  translate(transX,transY,0);
  box(200);
}
description
Use this method to get a cooliehat. You can get a cooliehat by its name or its number. Use printButtons to see what buttons are a cooliehat.
syntax
getCoolieHat(i_coolieHatNumb);
getCoolieHat(i_buttonName);
parameters
i_coolieHatNumb
int, the number of the cooliehat to return
i_sliderName
String, name of the button to return
returns
ControllCoolieHat, the cooliehat coresponding to the given number or name
usage
Web & Application
related