[haiku-bugs] Re: [Haiku] #7629: Patch to make BJoystick non blocking on read
- From: "caz_haiku" <trac@xxxxxxxxxxxx>
- Date: Thu, 02 Jun 2011 17:50:17 -0000
#7629: Patch to make BJoystick non blocking on read
-------------------------------+----------------------------
Reporter: caz_haiku | Owner: mmlr
Type: enhancement | Status: closed
Priority: normal | Milestone: R1
Component: Kits/Device Kit | Version: R1/Development
Resolution: fixed | Keywords: Joystick
Blocked By: | Blocking:
Has a Patch: 1 | Platform: All
-------------------------------+----------------------------
Comment (by caz_haiku):
Michael, Good work on this, i'll test it later this evening. The
original BJoystick by Be did work in a way similar to my changes but it
doesn't matter about that as long as it works as expected. The following
code was legal previously which i used in BeS9x, and without the
modifications no joysticks were opened. Anyway you have fixed it so it
works as expected, will test later.
{{{
GameStick::GameStick(input_interface *buffer) : jbuffer(buffer)
{
for(int i = 0; i < MAX_JOYSTICKS; i++)
sticks[i] = 0;
BJoystick stick;
char devName[B_OS_NAME_LENGTH];
for(int i = 0; i < stick.CountDevices() && i < MAX_JOYSTICKS; i++)
{
sticks[i] = new Joystick(i, buffer);
if((sticks[i]->GetDeviceName(i, devName) != B_OK) ||
(sticks[i]->Open(devName, true) < B_OK))
{
delete sticks[i];
sticks[i] = 0;
} else
sticks[i]->InitNames();
}
InitKeyNames();
}
}}}
--
Ticket URL: <http://dev.haiku-os.org/ticket/7629#comment:7>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.
Other related posts: