kopia lustrzana https://github.com/FreeSpacenav/libspnav
added spnav_cfg_reset, spnav_cfg_restore, and spnav_cfg_save.
rodzic
1cb5c2c80e
commit
97b2deda3a
1
proto.h
1
proto.h
|
@ -60,6 +60,7 @@ enum {
|
||||||
/* TODO ... more */
|
/* TODO ... more */
|
||||||
REQ_CFG_SAVE = 0x3ffe, /* save config file: R[6] status */
|
REQ_CFG_SAVE = 0x3ffe, /* save config file: R[6] status */
|
||||||
REQ_CFG_RESTORE, /* load config from file: R[6] status */
|
REQ_CFG_RESTORE, /* load config from file: R[6] status */
|
||||||
|
REQ_CFG_RESET, /* reset to default config: R[6] status */
|
||||||
|
|
||||||
REQ_CHANGE_PROTO = 0x5500
|
REQ_CHANGE_PROTO = 0x5500
|
||||||
};
|
};
|
||||||
|
|
18
spnav.c
18
spnav.c
|
@ -789,6 +789,24 @@ int spnav_dev_type(void)
|
||||||
return rr.data[0];
|
return rr.data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int spnav_cfg_reset(void)
|
||||||
|
{
|
||||||
|
struct reqresp rr = {0};
|
||||||
|
return request(REQ_CFG_RESET, &rr, TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
int spnav_cfg_restore(void)
|
||||||
|
{
|
||||||
|
struct reqresp rr = {0};
|
||||||
|
return request(REQ_CFG_RESTORE, &rr, TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
int spnav_cfg_save(void)
|
||||||
|
{
|
||||||
|
struct reqresp rr = {0};
|
||||||
|
return request(REQ_CFG_SAVE, &rr, TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
int spnav_cfg_set_sens(float s)
|
int spnav_cfg_set_sens(float s)
|
||||||
{
|
{
|
||||||
struct reqresp rr = {0};
|
struct reqresp rr = {0};
|
||||||
|
|
15
spnav.h
15
spnav.h
|
@ -223,6 +223,21 @@ enum {
|
||||||
SPNAV_MAX_BNACT
|
SPNAV_MAX_BNACT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Reset all settings to their default values. This change will not persist
|
||||||
|
* between spacenavd restarts, unless followed by a call to spnav_cfg_save.
|
||||||
|
*/
|
||||||
|
int spnav_cfg_reset(void);
|
||||||
|
|
||||||
|
/* Revert all the session settings to the values defined in the spacenavd
|
||||||
|
* configuration file. This change will not persist between spacenavd restarts,
|
||||||
|
* unless followed by a call to spnav_cfg_save.
|
||||||
|
*/
|
||||||
|
int spnav_cfg_restore(void);
|
||||||
|
|
||||||
|
/* Save all the current settings to the spacenavd configuration file. */
|
||||||
|
int spnav_cfg_save(void);
|
||||||
|
|
||||||
|
|
||||||
/* Set the global sensitivity.
|
/* Set the global sensitivity.
|
||||||
* cfgfile option: sensitivity
|
* cfgfile option: sensitivity
|
||||||
*/
|
*/
|
||||||
|
|
Ładowanie…
Reference in New Issue