Mercurial > sdl-ios-xcode
annotate docs/html/guide.html @ 1584:b786d9c15e42
Fixed bug #61
Date: Mon, 24 Feb 2003 13:35:11 +0800
From: "Leonidas"
Subject: [SDL] Re: Trigger mouse wheel event -- not in X-environment
I have looked into the codes for the IMPS/2 mouse wheel mode of fbcon driver.
But I found something weird.
Here's the original codes to set a mouse device into IMPS/2 mode in libSDL.
In the file src/video/fbcon/SDL_fbevents.c
In function static int set_imps2_mode(int fd)
...
Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
Uint8 reset = 0xff;
fd_set fdset;
struct timeval tv;
int retval = 0;
// Set mouse device fd into IMPS/2 mode
if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
// ??? then RESET it..???
if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
retval = 1;
}
}
...........
Since it sets IMPS/2 mode then reset it, so you will never get a mouse into
IMPS/2 mode to use its wheel.
What I did to make the wheel usable is remove the RESET codes.
....
if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
/*
if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
}
*/
retval = 1;
}
....
And in FB_OpenMouse(_THIS)
Make the device /dev/psaux to be setted into imps2 mode such that it can be
detected its a imps/2 mouse or not.
(my mouse device is on ps2, but the codes only set /dev/input/mice device
originally)
Then I have done, I can use the mouse wheel when SDL uses frame buff driver.
I dont exactly know I did right or wrong, I just change it for my usuage.
Correct me please, if I did something wrong.
Best regards,
Li Tsung Lin
IAP Product Dept. Engineer
EeRise Corp. (Image Processing System, Computer Vision System)
Hsin Tien, Taipei Hsien, Taiwan, R.O.C.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 22 Mar 2006 07:22:40 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL Guide</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="PREVIOUS" | |
13 TITLE="SDL Library Documentation" | |
14 HREF="index.html"><LINK | |
15 REL="NEXT" | |
16 TITLE="Preface" | |
17 HREF="guidepreface.html"></HEAD | |
18 ><BODY | |
19 CLASS="PART" | |
20 BGCOLOR="#FFF8DC" | |
21 TEXT="#000000" | |
22 LINK="#0000ee" | |
23 VLINK="#551a8b" | |
24 ALINK="#ff0000" | |
25 ><DIV | |
26 CLASS="NAVHEADER" | |
27 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
28 SUMMARY="Header navigation table" |
0 | 29 WIDTH="100%" |
30 BORDER="0" | |
31 CELLPADDING="0" | |
32 CELLSPACING="0" | |
33 ><TR | |
34 ><TH | |
35 COLSPAN="3" | |
36 ALIGN="center" | |
37 >SDL Library Documentation</TH | |
38 ></TR | |
39 ><TR | |
40 ><TD | |
41 WIDTH="10%" | |
42 ALIGN="left" | |
43 VALIGN="bottom" | |
44 ><A | |
45 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
46 ACCESSKEY="P" |
0 | 47 >Prev</A |
48 ></TD | |
49 ><TD | |
50 WIDTH="80%" | |
51 ALIGN="center" | |
52 VALIGN="bottom" | |
53 ></TD | |
54 ><TD | |
55 WIDTH="10%" | |
56 ALIGN="right" | |
57 VALIGN="bottom" | |
58 ><A | |
59 HREF="guidepreface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
60 ACCESSKEY="N" |
0 | 61 >Next</A |
62 ></TD | |
63 ></TR | |
64 ></TABLE | |
65 ><HR | |
66 ALIGN="LEFT" | |
67 WIDTH="100%"></DIV | |
68 ><DIV | |
69 CLASS="PART" | |
70 ><A | |
71 NAME="GUIDE" | |
72 ></A | |
73 ><DIV | |
74 CLASS="TITLEPAGE" | |
75 ><H1 | |
76 CLASS="TITLE" | |
77 >I. SDL Guide</H1 | |
78 ><DIV | |
79 CLASS="TOC" | |
80 ><DL | |
81 ><DT | |
82 ><B | |
83 >Table of Contents</B | |
84 ></DT | |
85 ><DT | |
86 ><A | |
87 HREF="guidepreface.html" | |
88 >Preface</A | |
89 ></DT | |
90 ><DT | |
91 >1. <A | |
92 HREF="guidethebasics.html" | |
93 >The Basics</A | |
94 ></DT | |
95 ><DT | |
96 >2. <A | |
97 HREF="guidevideo.html" | |
98 >Graphics and Video</A | |
99 ></DT | |
100 ><DT | |
101 >3. <A | |
102 HREF="guideinput.html" | |
103 >Input handling</A | |
104 ></DT | |
105 ><DT | |
106 >4. <A | |
107 HREF="guideexamples.html" | |
108 >Examples</A | |
109 ></DT | |
110 ></DL | |
111 ></DIV | |
112 ></DIV | |
113 ></DIV | |
114 ><DIV | |
115 CLASS="NAVFOOTER" | |
116 ><HR | |
117 ALIGN="LEFT" | |
118 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
119 SUMMARY="Footer navigation table" |
0 | 120 WIDTH="100%" |
121 BORDER="0" | |
122 CELLPADDING="0" | |
123 CELLSPACING="0" | |
124 ><TR | |
125 ><TD | |
126 WIDTH="33%" | |
127 ALIGN="left" | |
128 VALIGN="top" | |
129 ><A | |
130 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
131 ACCESSKEY="P" |
0 | 132 >Prev</A |
133 ></TD | |
134 ><TD | |
135 WIDTH="34%" | |
136 ALIGN="center" | |
137 VALIGN="top" | |
138 ><A | |
139 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
140 ACCESSKEY="H" |
0 | 141 >Home</A |
142 ></TD | |
143 ><TD | |
144 WIDTH="33%" | |
145 ALIGN="right" | |
146 VALIGN="top" | |
147 ><A | |
148 HREF="guidepreface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
149 ACCESSKEY="N" |
0 | 150 >Next</A |
151 ></TD | |
152 ></TR | |
153 ><TR | |
154 ><TD | |
155 WIDTH="33%" | |
156 ALIGN="left" | |
157 VALIGN="top" | |
158 >SDL Library Documentation</TD | |
159 ><TD | |
160 WIDTH="34%" | |
161 ALIGN="center" | |
162 VALIGN="top" | |
163 > </TD | |
164 ><TD | |
165 WIDTH="33%" | |
166 ALIGN="right" | |
167 VALIGN="top" | |
168 >Preface</TD | |
169 ></TR | |
170 ></TABLE | |
171 ></DIV | |
172 ></BODY | |
173 ></HTML | |
174 > |