mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-12 20:29:12 +00:00
Replace WS_NOZMAP on WS_NOMAP.
ok matthieu@
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
/* $OpenBSD: ws.c,v 1.48 2011/11/19 12:46:08 shadchin Exp $ */
|
/* $OpenBSD: ws.c,v 1.49 2011/11/19 13:12:49 shadchin Exp $ */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -83,8 +83,6 @@ static XF86ModuleVersionInfo VersionRec = {
|
|||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WS_NOZMAP 0
|
|
||||||
|
|
||||||
XF86ModuleData wsModuleData = {&VersionRec,
|
XF86ModuleData wsModuleData = {&VersionRec,
|
||||||
SetupProc, TearDownProc };
|
SetupProc, TearDownProc };
|
||||||
|
|
||||||
@@ -146,7 +144,7 @@ wsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
|||||||
priv->buttons = DFLTBUTTONS;
|
priv->buttons = DFLTBUTTONS;
|
||||||
buttons_from = X_DEFAULT;
|
buttons_from = X_DEFAULT;
|
||||||
}
|
}
|
||||||
priv->negativeZ = priv->positiveZ = WS_NOZMAP;
|
priv->negativeZ = priv->positiveZ = WS_NOMAP;
|
||||||
s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5");
|
s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5");
|
||||||
if (s) {
|
if (s) {
|
||||||
int b1, b2;
|
int b1, b2;
|
||||||
@@ -169,7 +167,7 @@ wsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
|
|||||||
}
|
}
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
priv->negativeW = priv->positiveW = WS_NOZMAP;
|
priv->negativeW = priv->positiveW = WS_NOMAP;
|
||||||
s = xf86SetStrOption(pInfo->options, "WAxisMapping", "6 7");
|
s = xf86SetStrOption(pInfo->options, "WAxisMapping", "6 7");
|
||||||
if (s) {
|
if (s) {
|
||||||
int b1, b2;
|
int b1, b2;
|
||||||
@@ -582,8 +580,8 @@ wsReadInput(InputInfoPtr pInfo)
|
|||||||
xf86PostMotionEvent(pInfo->dev, 0, 0, 2,
|
xf86PostMotionEvent(pInfo->dev, 0, 0, 2,
|
||||||
dx, dy);
|
dx, dy);
|
||||||
}
|
}
|
||||||
if (dz && priv->negativeZ != WS_NOZMAP
|
if (dz && priv->negativeZ != WS_NOMAP
|
||||||
&& priv->positiveZ != WS_NOZMAP) {
|
&& priv->positiveZ != WS_NOMAP) {
|
||||||
buttons &= ~(priv->negativeZ | priv->positiveZ);
|
buttons &= ~(priv->negativeZ | priv->positiveZ);
|
||||||
if (dz < 0) {
|
if (dz < 0) {
|
||||||
DBG(4, ErrorF("Z -> button %d\n",
|
DBG(4, ErrorF("Z -> button %d\n",
|
||||||
@@ -597,8 +595,8 @@ wsReadInput(InputInfoPtr pInfo)
|
|||||||
buttons |= zbutton;
|
buttons |= zbutton;
|
||||||
dz = 0;
|
dz = 0;
|
||||||
}
|
}
|
||||||
if (dw && priv->negativeW != WS_NOZMAP
|
if (dw && priv->negativeW != WS_NOMAP
|
||||||
&& priv->positiveW != WS_NOZMAP) {
|
&& priv->positiveW != WS_NOMAP) {
|
||||||
buttons &= ~(priv->negativeW | priv->positiveW);
|
buttons &= ~(priv->negativeW | priv->positiveW);
|
||||||
if (dw < 0) {
|
if (dw < 0) {
|
||||||
DBG(4, ErrorF("W -> button %d\n",
|
DBG(4, ErrorF("W -> button %d\n",
|
||||||
|
|||||||
@@ -26,10 +26,12 @@ extern int ws_debug_level;
|
|||||||
# define DBG(lvl, f)
|
# define DBG(lvl, f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NAXES 2 /* X and Y axes only */
|
#define NAXES 2 /* X and Y axes only */
|
||||||
#define NBUTTONS 32 /* max theoretical buttons */
|
#define NBUTTONS 32 /* max theoretical buttons */
|
||||||
#define DFLTBUTTONS 3 /* default number of buttons */
|
#define DFLTBUTTONS 3 /* default number of buttons */
|
||||||
#define NUMEVENTS 16 /* max # of ws events to read at once */
|
#define NUMEVENTS 16 /* max # of ws events to read at once */
|
||||||
|
|
||||||
|
#define WS_NOMAP 0
|
||||||
|
|
||||||
typedef struct WSDevice {
|
typedef struct WSDevice {
|
||||||
char *devName; /* device name */
|
char *devName; /* device name */
|
||||||
|
|||||||
Reference in New Issue
Block a user