Skip to content
Snippets Groups Projects
Select Git revision
  • 70cffcc870cef1d38576111e0b7072b9d3173012
  • master default
  • library-names
  • fix_script_header
  • fix_libdir
  • fix_cmake_hdf5
  • partition
  • cgnsUnstructured
  • partitioning
  • HighOrderBLCurving
  • gmsh_3_0_5
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
30 results

unix2dos.awk

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    GamePad.h 1.18 KiB
    // Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    //
    // Contributed by Gilles Marckmann <gilles.marckmann@ec-nantes.fr>
    
    #ifndef GAMEPAD_H
    #define GAMEPAD_H
    
    #define GP_RANGE 1.0
    #define GP_DEV 16
    #define GP_BUTTONS 32
    #define GP_AXES 6
    
    #include "GmshConfig.h"
    
    #if defined(WIN32)
    #include <windows.h>
    #include <mmsystem.h>
    #elif defined(HAVE_LINUX_JOYSTICK)
    #include <linux/joystick.h>
    #include <fcntl.h>
    #define GAMEPAD_DEV "/dev/input/js0"
    #endif
    
    class GamePad {
    public:
      bool active;
      bool toggle_status[GP_BUTTONS];
      bool event_read;
      double frequency;
      GamePad();
      ~GamePad();
      double axe[GP_AXES];
      bool button[GP_BUTTONS];
      bool toggle(const int _nbut);
      int read_event();
      void affiche();
      int button_map[10];
      int axe_map[8];
    
    private:
      char name[256];
    #if defined(WIN32)
      int gamepad_fd;
      JOYCAPS caps;
      JOYINFOEX infoex;
      JOYINFO info;
      int axes;
      int buttons;
    #elif defined(HAVE_LINUX_JOYSTICK)
      int gamepad_fd;
      js_event event;
      __u32 version;
      __u8 axes;
      __u8 buttons;
    #else
      int axes;
      int buttons;
    #endif
    };
    
    #endif