more extended API entry points

pull/15/head
John Tsiombikas 2022-02-12 19:15:36 +02:00
rodzic bab9f676b9
commit d273b5d917
2 zmienionych plików z 55 dodań i 0 usunięć

14
proto.h
Wyświetl plik

@ -40,7 +40,21 @@ enum {
REQ_GCFG_DEADZONE, /* get deadzones: R[0-5] values R[6] status */
REQ_SCFG_INVERT, /* set invert axes: Q[0-5] invert - R[6] status */
REQ_GCFG_INVERT, /* get invert axes: R[0-5] invert R[6] status */
REQ_SCFG_AXISMAP, /* set axis mapping: Q[0-5] map - R[6] status */
REQ_GCFG_AXISMAP, /* get axis mapping: R[0-5] map R[6] status */
REQ_SCFG_BNMAP, /* set button mapping: Q[0] hw bidx Q[1] map bidx - R[6] status */
REQ_GCFG_BNMAP, /* get button mapping: Q[0] hw bidx - R[0] hw bidx R[1] map bidx R[6] status */
REQ_SCFG_BNACTION, /* set button action: Q[0] bidx Q[1] action - R[6] status */
REQ_GCFG_BNACTION, /* get button action: Q[0] bidx - R[0] bidx R[1] action R[6] status */
REQ_SCFG_KBMAP, /* set keyboard mapping: Q[0] bidx Q[1] keysym - R[6] status */
REQ_GCFG_KBMAP, /* get keyboard mapping: Q[0] bidx - R[0] bidx R[1] keysym R[6] status */
REQ_SCFG_LED, /* set LED state: Q[0] state - R[6] status */
REQ_GCFG_LED, /* get LED state: R[0] state R[6] status */
REQ_SCFG_SERDEV, /* set serial device path: Q[0] length, followed by <length> bytes - R[6] status */
REQ_GCFG_SERDEV, /* get serial device path: R[0] length R[6] status, followed by <length> bytes */
/* TODO ... more */
REQ_CFG_SAVE = 0x3ffe, /* save config file: R[6] status */
REQ_CFG_RESTORE, /* load config from file: R[6] status */
REQ_CHANGE_PROTO = 0x5500
};

41
spnav.h
Wyświetl plik

@ -166,6 +166,47 @@ int spnav_dev_buttons(void);
int spnav_dev_axes(void);
/* configuration API
* -----------------
* This API is mostly targeted towards configuration management tools (like
* spnavcfg). Normal clients should avoid changing the spacenavd configuration.
* They should use the non-persistent client-specific settings instead.
*
* All functions with return 0 on success, -1 on failure, unless noted otherwise
*/
/* Set the global sensitivity.
* cfgfile option: sensitivity
*/
int spnav_cfg_set_sens(float s);
float spnav_cfg_get_sens(void); /* returns the sensitivity or <0.0 on error */
/* Set the per-axis sensitivity for all 6 axes. svec should point to an array of
* 6 floats.
* cfgfile options: sensitivity-translation-[x|y|z], sensitivity-rotation-[x|y|z]
*/
int spnav_cfg_set_axis_sens(const float *svec);
int spnav_cfg_get_axis_sens(float *svecret); /* writes 6 floats through svec */
/* Set the deadzone for all 6 axes. dead should point to an array of 6 ints.
* cfgfile options: dead-zone-translation-[x|y|z], dead-zone-rotation-[x|y|z]
*/
int spnav_cfg_set_deadzones(const int *dead);
int spnav_cfg_get_deadzones(int *deadret); /* writes 6 ints through dead */
/* Set the axis invert state
* 0: normal, 1: inverted. order: MSB [ ... RZ|RY|RX|TZ|TY|TX] LSB
* cfgfile options: invert-trans, invert-rot
*/
int spnav_cfg_set_invert(int invbits);
int spnav_cfg_get_invert(void); /* returns invert bits, -1 on error */
/* Control device LED
* 0: off, 1: on, 2: auto
* cfgfile option: led
*/
int spnav_cfg_set_led(int state);
int spnav_cfg_get_led(void); /* returns led setting, -1 on error */
#ifdef __cplusplus
}