Skip to content
Snippets Groups Projects
Select Git revision
  • cf473f274db07e19eec25f8c008243cf25173de8
  • master default protected
  • overlaps_tags_and_distributed_export
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

FaultZone.h

Blame
  • 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