Re: Spaceball 3003 - XEvents

New Message Reply Date view Thread view Subject view Author view

Javier Abadia Miranda (abadia++at++sgonyx.ita.es)
Fri, 30 Jan 1998 09:08:18 +0100


On Jan 29, 10:07am, Norbert Kociok wrote:
> Subject: Spaceball 3003 - XEvents
> Hello Javier,
>
> I have read your message and it describes the same problem that I have.
>
> I try to integrate the Space Mouse into the perfly-application.
>
> I think that you also use the modified sourcecode of complex.C from
> Joerg Wallmersperger.
> But I am writing under ANSI-C and not under C++.
>
> I think that the best way it is to use the XInput Extension. So I try to
> manage the event-handling of the Space Mouse and the normal mouse with
> the X-Event-model by using XSelectInput.

I used to think so, but I have had some problems. The most important
is that the XInput driver for the Spaceball is for the model 2003
(that has 8 buttons) and my spaceball is the 3003 (only 2 buttons).

Problem: I only receive events for one of the buttons, and I need
to control both. I don't know if I can configure the driver or
where I can get the 3003 driver.

> But because the perfly-application is using the pfuMouse-structure, it
> is necessary to convert the X-Event-structure into the
> pfuEvent-structure.
> It is possible by using the routines:
> pfuMouseButtonClick(&ViewState->mouse, PFUDEV_MOUSE_LEFT_DOWN,x, y,
> pfuMapXTime(button_event->time));
>
> Look therefore at the man-page of pfuInitInput.

Again ?

>
> Till this point I am now. When I start my perfly-version I receive the
> error:
> X Error of failed request: BadAccess (attempt to access private
> resource denied)
> Major opcode of failed request: 2 (X_ChangeWindowAttributes)
> Serial number of failed request: 254
> Current serial number in output stream: 260

The problem is that pfuInitInput() routines do something to the
main window that prevent XSelectExtensionEvent() from working.

BUT NOBODY HAS TOLD ME WHAT !

I solved the problem by commenting out every pfuInput and pfXformer
call and programming a driving model myself.

> The second problem is, if there is anywhere a routine which convert the
> Space Mouse-XEvents into the pfuMouse-structure.

Well, perhaps you could do the conversion yourself. pfuMouse struct
is quite simple. But I suspect that It's not enough: you would like
to generate a pfuEvent. You could try to fill the struct yourself
and add it to the events queue manually. :-)

>
> Maybe you have some other ideas with which I can solve my problems.

Well. I have chosen to code everything myself. I have writen code
to read Spaceball packets directly from /dev/ttyd device, and I
have writen a fly model adhoc to my app.

Now it works, but It has been harder that it should have been.

>
> It would be good to hear from you.

It would be good to hear from others, too!!

Aaadios.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:39 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.