Hello,

I'm trying to use wxWidgets to get mouse, keyboard and joystick events without creating a window context as I'm using GLUT for that.

Can it be done and if so how? All the examples I see have the events tied to some sort of visual context.

Recommended Answers

All 5 Replies

If you are using GLUT for making the window, why not use it for the mouse and keyboard events too. It has all these things built into it. Look here.

Generally, the mouse events and keyboard events are intimately linked to the window context. So, that is why any library that creates a window (like GLUT, SDL, Qt, VCL, wxWidget, etc.) also has all the mouse and keyboard event facilities as well. They aren't really separable or standalone (for instance, you can't create a window that doesn't have any handling of mouse or key events.. because how else would you close the window!).

The problem is they're limited. For example the mouse call back doesn't support a mouse wheel?

Well, GLUT is a limited library. It is not really meant for complex applications. Why don't you use wxWidget or Qt to create the window then and render your openGL scene inside the wxWidget window, as in this tutorial. And even better for Qt.

commented: Excellent advice as (almost) always ;) +16

I agree with Mike,
use wxWidgets and paint your OGL stuffs in wxGLCanvas

Well... it's a matter of time. The project was already written in glut and I'm not in the mood to hunt through for all the glut related calls.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.