O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utilizing mouse input and creating camera control

The keyboard isn't the only piece of hardware we can get input from. Mouse-clicks also trigger events and we use the same methods to respond to them. The event names for the mouse buttons are:

  • "mouse1": Left mouse button
  • "mouse2": Middle mouse button
  • "mouse3": Right mouse button

Like keyboard keys, the mouse events also have versions that we can take advantage of.

In order to make use of the mouse, we first have to disable the default mouse camera control. For that, we turn back to our old friend base. The method base.disableMouse() has a deceptive name, because it doesn't actually turn off mouse input. Instead, it removes the camera control scheme that Panda3D uses by default, and allows us to use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required