Mercurial > sdl-ios-xcode
annotate docs/html/wm.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 >Window Management</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="UP" | |
13 TITLE="SDL Reference" | |
14 HREF="reference.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_Overlay" | |
17 HREF="sdloverlay.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_WM_SetCaption" | |
20 HREF="sdlwmsetcaption.html"><META | |
21 NAME="KEYWORD" | |
22 CONTENT="wm"><META | |
23 NAME="KEYWORD" | |
24 CONTENT="function"></HEAD | |
25 ><BODY | |
26 CLASS="CHAPTER" | |
27 BGCOLOR="#FFF8DC" | |
28 TEXT="#000000" | |
29 LINK="#0000ee" | |
30 VLINK="#551a8b" | |
31 ALINK="#ff0000" | |
32 ><DIV | |
33 CLASS="NAVHEADER" | |
34 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
35 SUMMARY="Header navigation table" |
0 | 36 WIDTH="100%" |
37 BORDER="0" | |
38 CELLPADDING="0" | |
39 CELLSPACING="0" | |
40 ><TR | |
41 ><TH | |
42 COLSPAN="3" | |
43 ALIGN="center" | |
44 >SDL Library Documentation</TH | |
45 ></TR | |
46 ><TR | |
47 ><TD | |
48 WIDTH="10%" | |
49 ALIGN="left" | |
50 VALIGN="bottom" | |
51 ><A | |
52 HREF="sdloverlay.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
53 ACCESSKEY="P" |
0 | 54 >Prev</A |
55 ></TD | |
56 ><TD | |
57 WIDTH="80%" | |
58 ALIGN="center" | |
59 VALIGN="bottom" | |
60 ></TD | |
61 ><TD | |
62 WIDTH="10%" | |
63 ALIGN="right" | |
64 VALIGN="bottom" | |
65 ><A | |
66 HREF="sdlwmsetcaption.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
67 ACCESSKEY="N" |
0 | 68 >Next</A |
69 ></TD | |
70 ></TR | |
71 ></TABLE | |
72 ><HR | |
73 ALIGN="LEFT" | |
74 WIDTH="100%"></DIV | |
75 ><DIV | |
76 CLASS="CHAPTER" | |
77 ><H1 | |
78 ><A | |
79 NAME="WM" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
80 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
81 >Chapter 7. Window Management</H1 |
0 | 82 ><DIV |
83 CLASS="TOC" | |
84 ><DL | |
85 ><DT | |
86 ><B | |
87 >Table of Contents</B | |
88 ></DT | |
89 ><DT | |
90 ><A | |
91 HREF="sdlwmsetcaption.html" | |
92 >SDL_WM_SetCaption</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
93 > -- Sets the window tile and icon name.</DT |
0 | 94 ><DT |
95 ><A | |
96 HREF="sdlwmgetcaption.html" | |
97 >SDL_WM_GetCaption</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
98 > -- Gets the window title and icon name.</DT |
0 | 99 ><DT |
100 ><A | |
101 HREF="sdlwmseticon.html" | |
102 >SDL_WM_SetIcon</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
103 > -- Sets the icon for the display window.</DT |
0 | 104 ><DT |
105 ><A | |
106 HREF="sdlwmiconifywindow.html" | |
107 >SDL_WM_IconifyWindow</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
108 > -- Iconify/Minimise the window</DT |
0 | 109 ><DT |
110 ><A | |
111 HREF="sdlwmtogglefullscreen.html" | |
112 >SDL_WM_ToggleFullScreen</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
113 > -- Toggles fullscreen mode</DT |
0 | 114 ><DT |
115 ><A | |
116 HREF="sdlwmgrabinput.html" | |
117 >SDL_WM_GrabInput</A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
118 > -- Grabs mouse and keyboard input.</DT |
0 | 119 ></DL |
120 ></DIV | |
121 ><P | |
122 >SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)</P | |
123 ></DIV | |
124 ><DIV | |
125 CLASS="NAVFOOTER" | |
126 ><HR | |
127 ALIGN="LEFT" | |
128 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
129 SUMMARY="Footer navigation table" |
0 | 130 WIDTH="100%" |
131 BORDER="0" | |
132 CELLPADDING="0" | |
133 CELLSPACING="0" | |
134 ><TR | |
135 ><TD | |
136 WIDTH="33%" | |
137 ALIGN="left" | |
138 VALIGN="top" | |
139 ><A | |
140 HREF="sdloverlay.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
141 ACCESSKEY="P" |
0 | 142 >Prev</A |
143 ></TD | |
144 ><TD | |
145 WIDTH="34%" | |
146 ALIGN="center" | |
147 VALIGN="top" | |
148 ><A | |
149 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
150 ACCESSKEY="H" |
0 | 151 >Home</A |
152 ></TD | |
153 ><TD | |
154 WIDTH="33%" | |
155 ALIGN="right" | |
156 VALIGN="top" | |
157 ><A | |
158 HREF="sdlwmsetcaption.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
159 ACCESSKEY="N" |
0 | 160 >Next</A |
161 ></TD | |
162 ></TR | |
163 ><TR | |
164 ><TD | |
165 WIDTH="33%" | |
166 ALIGN="left" | |
167 VALIGN="top" | |
168 >SDL_Overlay</TD | |
169 ><TD | |
170 WIDTH="34%" | |
171 ALIGN="center" | |
172 VALIGN="top" | |
173 ><A | |
174 HREF="reference.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
175 ACCESSKEY="U" |
0 | 176 >Up</A |
177 ></TD | |
178 ><TD | |
179 WIDTH="33%" | |
180 ALIGN="right" | |
181 VALIGN="top" | |
182 >SDL_WM_SetCaption</TD | |
183 ></TR | |
184 ></TABLE | |
185 ></DIV | |
186 ></BODY | |
187 ></HTML | |
188 > |