Mercurial > sdl-ios-xcode
annotate docs/html/sdlgetvideoinfo.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_GetVideoInfo</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
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="UP" | |
13 TITLE="Video" | |
14 HREF="video.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_GetVideoSurface" | |
17 HREF="sdlgetvideosurface.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_VideoDriverName" | |
20 HREF="sdlvideodrivername.html"></HEAD | |
21 ><BODY | |
22 CLASS="REFENTRY" | |
23 BGCOLOR="#FFF8DC" | |
24 TEXT="#000000" | |
25 LINK="#0000ee" | |
26 VLINK="#551a8b" | |
27 ALINK="#ff0000" | |
28 ><DIV | |
29 CLASS="NAVHEADER" | |
30 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
31 SUMMARY="Header navigation table" |
0 | 32 WIDTH="100%" |
33 BORDER="0" | |
34 CELLPADDING="0" | |
35 CELLSPACING="0" | |
36 ><TR | |
37 ><TH | |
38 COLSPAN="3" | |
39 ALIGN="center" | |
40 >SDL Library Documentation</TH | |
41 ></TR | |
42 ><TR | |
43 ><TD | |
44 WIDTH="10%" | |
45 ALIGN="left" | |
46 VALIGN="bottom" | |
47 ><A | |
48 HREF="sdlgetvideosurface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
49 ACCESSKEY="P" |
0 | 50 >Prev</A |
51 ></TD | |
52 ><TD | |
53 WIDTH="80%" | |
54 ALIGN="center" | |
55 VALIGN="bottom" | |
56 ></TD | |
57 ><TD | |
58 WIDTH="10%" | |
59 ALIGN="right" | |
60 VALIGN="bottom" | |
61 ><A | |
62 HREF="sdlvideodrivername.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
63 ACCESSKEY="N" |
0 | 64 >Next</A |
65 ></TD | |
66 ></TR | |
67 ></TABLE | |
68 ><HR | |
69 ALIGN="LEFT" | |
70 WIDTH="100%"></DIV | |
71 ><H1 | |
72 ><A | |
73 NAME="SDLGETVIDEOINFO" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
74 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
75 >SDL_GetVideoInfo</H1 |
0 | 76 ><DIV |
77 CLASS="REFNAMEDIV" | |
78 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
79 NAME="AEN1100" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_GetVideoInfo -- returns a pointer to information about the video hardware</DIV | |
84 ><DIV | |
85 CLASS="REFSYNOPSISDIV" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN1103" |
0 | 88 ></A |
89 ><H2 | |
90 >Synopsis</H2 | |
91 ><DIV | |
92 CLASS="FUNCSYNOPSIS" | |
93 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
94 NAME="AEN1104" |
0 | 95 ></A |
96 ><P | |
97 ></P | |
98 ><PRE | |
99 CLASS="FUNCSYNOPSISINFO" | |
100 >#include "SDL.h"</PRE | |
101 ><P | |
102 ><CODE | |
103 ><CODE | |
104 CLASS="FUNCDEF" | |
105 >SDL_VideoInfo *<B | |
106 CLASS="FSFUNC" | |
107 >SDL_GetVideoInfo</B | |
108 ></CODE | |
109 >(void);</CODE | |
110 ></P | |
111 ><P | |
112 ></P | |
113 ></DIV | |
114 ></DIV | |
115 ><DIV | |
116 CLASS="REFSECT1" | |
117 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
118 NAME="AEN1110" |
0 | 119 ></A |
120 ><H2 | |
121 >Description</H2 | |
122 ><P | |
123 >This function returns a read-only pointer to <A | |
124 HREF="sdlvideoinfo.html" | |
125 >information</A | |
126 > about the video | |
127 hardware. If this is called before <A | |
128 HREF="sdlsetvideomode.html" | |
129 >SDL_SetVideoMode</A | |
130 >, the | |
131 <TT | |
132 CLASS="STRUCTFIELD" | |
133 ><I | |
134 >vfmt</I | |
135 ></TT | |
136 > member of the returned structure will contain the | |
137 pixel format of the "best" video mode.</P | |
138 ></DIV | |
139 ><DIV | |
140 CLASS="REFSECT1" | |
141 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
142 NAME="AEN1116" |
0 | 143 ></A |
144 ><H2 | |
145 >See Also</H2 | |
146 ><P | |
147 ><A | |
148 HREF="sdlsetvideomode.html" | |
149 ><TT | |
150 CLASS="FUNCTION" | |
151 >SDL_SetVideoMode</TT | |
152 ></A | |
153 >, | |
154 <A | |
155 HREF="sdlvideoinfo.html" | |
156 ><SPAN | |
157 CLASS="STRUCTNAME" | |
158 >SDL_VideoInfo</SPAN | |
159 ></A | |
160 ></P | |
161 ></DIV | |
162 ><DIV | |
163 CLASS="NAVFOOTER" | |
164 ><HR | |
165 ALIGN="LEFT" | |
166 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
167 SUMMARY="Footer navigation table" |
0 | 168 WIDTH="100%" |
169 BORDER="0" | |
170 CELLPADDING="0" | |
171 CELLSPACING="0" | |
172 ><TR | |
173 ><TD | |
174 WIDTH="33%" | |
175 ALIGN="left" | |
176 VALIGN="top" | |
177 ><A | |
178 HREF="sdlgetvideosurface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
179 ACCESSKEY="P" |
0 | 180 >Prev</A |
181 ></TD | |
182 ><TD | |
183 WIDTH="34%" | |
184 ALIGN="center" | |
185 VALIGN="top" | |
186 ><A | |
187 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
188 ACCESSKEY="H" |
0 | 189 >Home</A |
190 ></TD | |
191 ><TD | |
192 WIDTH="33%" | |
193 ALIGN="right" | |
194 VALIGN="top" | |
195 ><A | |
196 HREF="sdlvideodrivername.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
197 ACCESSKEY="N" |
0 | 198 >Next</A |
199 ></TD | |
200 ></TR | |
201 ><TR | |
202 ><TD | |
203 WIDTH="33%" | |
204 ALIGN="left" | |
205 VALIGN="top" | |
206 >SDL_GetVideoSurface</TD | |
207 ><TD | |
208 WIDTH="34%" | |
209 ALIGN="center" | |
210 VALIGN="top" | |
211 ><A | |
212 HREF="video.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
213 ACCESSKEY="U" |
0 | 214 >Up</A |
215 ></TD | |
216 ><TD | |
217 WIDTH="33%" | |
218 ALIGN="right" | |
219 VALIGN="top" | |
220 >SDL_VideoDriverName</TD | |
221 ></TR | |
222 ></TABLE | |
223 ></DIV | |
224 ></BODY | |
225 ></HTML | |
226 > |