view docs/index.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 74212992fb08
children 14717b52abc0
line wrap: on
line source

<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN">
<HTML
><HEAD
><TITLE
>Introduction</TITLE
>
</HEAD
><BODY
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
>
<HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="PREFACE"
><H1
><A
NAME="AEN8"
>Introduction</A
></H1
><P
>This library is designed to make it easy to write games that run on Linux,
Win32 and BeOS using the various native high-performance media interfaces,
(for video, audio, etc) and presenting a single source-code level API to
your application.  This is a fairly low level API, but using this, completely
portable applications can be written with a great deal of flexibility.</P
><P
>The library is loaded as a dynamically linked library on its native
platform, and is currently compiled natively for Linux, compiled for
Win32 using a Linux hosted GCC
<A
HREF="http://www.libsdl.org/Xmingw32/"
TARGET="_top"
>cross-compilation</A
>
environment, and compiled using the EGCS C++ compiler under BeOS.</P
><P
>An introduction to SDL can be found online at:
<A
HREF="http://www.libsdl.org/intro/toc.html"
TARGET="_top"
>http://www.libsdl.org/intro/</A
>&#13;</P
><P
>There are code examples on each of the main library pages, and there are
fully fleshed example C++ classes and programs in the examples archive,
available on the
<A
HREF="http://www.libsdl.org/download.html"
TARGET="_top"
>SDL download page</A
>.</P
><P
>For an introduction to basic multi-media programming concepts, you might try
some of the following links:
<P
></P
><UL
><LI
><P
><A
HREF="http://www.ziron.com/links/"
TARGET="_top"
>Game Programming Links</A
></P
></LI
><LI
><P
><A
HREF="http://developer.dungeon-crawl.com/"
TARGET="_top"
>Game Developer Search Engine</A
></P
></LI
></UL
></P
><P
>Enjoy!</P
><P
>&nbsp;&nbsp;&nbsp; Sam Lantinga
<TT
CLASS="EMAIL"
>&#60;<A
HREF="mailto:slouken@libsdl.org"
><A
HREF="mailto:slouken@libsdl.org"
TARGET="_top"
>slouken@libsdl.org</A
></A
>&#62;</TT
></P
>
<P>
<br><br><HR>
<H1>Table of Contents</H1>
<UL>
<LI><A HREF="html/index.html">Full Table of Contents</A></LI>
<LI><A HREF="html/guide.html">The SDL Guide</A></LI>
<LI><A HREF="html/reference.html">The SDL Reference</A></LI>
<UL>
<LI><A HREF="html/general.html">Initialization</A></LI>
<LI><A HREF="html/video.html">Video</A></LI>
<LI><A HREF="html/wm.html">Window Manager</A></LI>
<LI><A HREF="html/event.html">Event Handling</A></LI>
<LI><A HREF="html/joystick.html">Joystick</A></LI>
<LI><A HREF="html/audio.html">Audio</A></LI>
<LI><A HREF="html/cdrom.html">CDROM</A></LI>
<LI><A HREF="html/thread.html">Threads</A></LI>
<LI><A HREF="html/time.html">Timers</A></LI>
</UL>
</UL>
</DIV
></BODY
></HTML
>