Menu

Using Joysticks in Advmenu

2005-01-25
2013-05-20
  • Nobody/Anonymous

    I'm using advmenu on Linux under x.org, and while I can move about the menu using the paralell port joystick, I'd like to remap the buttons on the pad.  I've looked through the docs and it seems it is only possible to remap the keyboard controls, and not the joystick.    Can anyone point me in the the right direction to do this?  I'm assuming it's something along the lines of event_assign quit joypad0_button0 or something.

    Also, using event_repeat in my advmenu.rc file only changed the speed of the keyboard repeat rate, not the joysticks.

    Any Help Appreciated

     
    • Nobody/Anonymous

      To remap your joystick or joypad using keyBoard
      http://qjoypad.sourceforge.net/

      To diagnose your Joypad or calibrate it
      http://wolfpack.twu.net/libjsw/

       
    • Nobody/Anonymous

      Hmm, seems like a bodge way of doing it to me.  Basically, I'm creating a cocktail table using advmenu as the main frontend, and I'm hoping to use a single button to quit/credit/start all the emulators.

      With mame/mess this isn't too much hassle, but I was hoping that advmenu had the option of configuring the joystick inputs so I wouldn't have to rely on an external program.

      The big plan is to basically use 2 SNES pads wired up to a proper JAMMA joystick harness for the player directions/buttons, and another SNES pad wired up for any else, such as test/credit/exit etc.

      I suppose one way to do it could be to use qjoypad and map the 3rd joystick to keys such as ESC and ctrl-Q,   I shall have to look into it.  Thanks for the links, I'll report back on how far I get.

      Cheers!

       
    • Nobody/Anonymous

      (Sigh)
      Just had a quick play with qjoypad and advmenu and yep, it does work, but it looks like I'm going to find a way for advmenu to ignore joystick input, as atm if I setup joystick2_button2 to something like F6 in qjoypad, advmenu see's both the joystick2_button2 and F6 being pressed at the same time.

      The only way round that I see is to completely disable joystick input into advmenu, and setup qjoypad to use the player 1 directional pad as the arrow keys, but this is going to cause headaches as I'd like to be able to quit out of advmenu and use joy2mouse to steer about the desktop, which means unless I kill qjoypad when I exit advmenu, it's going to do some wierd stuff when I move the joystick. 

      On the plus side it does mean that I can finally get zsnes and gngeo to quit on a single joystick button, but I've no idea how I'm going to get UAE and any other prog that doesn't use ESC as quit to play ball.

      If only advmenu could let you redefine joystick input, then I wouldn't have to do most of this bodging about......

       
    • Nobody/Anonymous

      Gaaargh!

      I've been playing about with the device_joystick in x.org/linux option to pretty much no avail.  What I'm trying to do is to make advmenu only read input from one specific controller, instead of all of them at once.
      According to advdev.txt the syntax is
      I've tried:
      device_joystick raw /dev/js0 and device_joystick raw /dev/input/js0
      This doesn't stop the second joystick from being used, ie pressing up on js1 or js0 still causes the menu to scroll up

      device_joystick sdl /dev/input/js0
      has the same behaviour as raw

      device_joystick event /dev/event/event3
      I can cat /dev/event/event3 and roll the joypad, get lots of luvvly garbage, but advmenu stops responding to ALL joystick input if I use this option

      So, unless advmenu gets some joystick configuration support, it looks like I'm going to have to bodge it by setting up qjoypad to load just before advmenu, set the joypad buttons to keys such as arrow up/down etc.  I'll also have to set device_joystick none, and figure out a way to unload qjoypad again when I exit advmenu.

       
    • Nobody/Anonymous

      I've found a better way rather than using qjoypad.
      Just went through the advance/menu/text.cc file and changed this:
      static void int_joystick_button_raw_poll()
      {
              for(int i=0;i<joystickb_count_get();++i) {
                      for(int j=0;j<joystickb_button_count_get(i);++j) {
                              if (joystickb_button_get(i, j)) {
                                      switch (j) {
                                      case 0 :
                                              event_push(EVENT_ENTER);
                                              break;
                                      case 1 :
                                              event_push(EVENT_ESC);
                                              break;
                                      case 2 :
                                              event_push(EVENT_MENU);
                                              break;
                                      case 3 :
                                              event_push(EVENT_PREVIEW);
                                              break;
                                      case 4 :
                                              event_push(EVENT_MODE);
                                              break;
                                      }
                              }
                      }
              }
      }
      static void int_joystick_button_raw_poll()
      {
              for(int i=0;i<joystickb_count_get();++i) {
                      for(int j=0;j<joystickb_button_count_get(i);++j) {
                              if (joystickb_button_get(i, j)) {
                                      switch (j) {
                                      case 0 :
                                              event_push(EVENT_ENTER);
                                              break;
                                      case 1 :
                                              event_push(EVENT_ENTER);
                                              break;
                                      case 2 :
                                              event_push(EVENT_ENTER);
                                              break;
                                      case 3 :
                                              event_push(EVENT_EMU);
                                              break;
                                      case 4 :
                                              event_push(EVENT_PREVIEW);
                                              break;

                                      case 5 :
                                              event_push(EVENT_PREVIEW);
                                              break;

                                      case 6 :
                                              event_push(EVENT_ESC);
                                              break;

                                      case 7 :
                                              event_push(EVENT_ENTER);
                                              break;

      Which sets up my lpt snes pad fine.
      To This:

       

Log in to post a comment.