Kay Sindre Bærulfsen


Device::SpaceNavigator - Read data from 3Dconnexion SpaceNavigator


  use Device::SpaceNavigator;

  my $nav = Device::SpaceNavigator->new();

  while ($nav->update()) {
      printf "Pitch:%i / Roll:%i / Yaw:%i X:%i / Y:%i / Z:%i Left button:%s Right button:%s\n",
          $nav->pitch(), $nav->roll(), $nav->yaw(),
          $nav->x(), $nav->y(), $nav->z(),
          $nav->left_button ? 'Pressed' : 'Released',
          $nav->right_button ? 'Pressed' : 'Released';



This module gives you a interface to read values from a connected 3Dconnexion SpaceNavigator. This awsome device has 6 axes; x, y, z, pitch, roll and yaw. In addition, it has two buttons.



Creates a new object for reading events from the device. Takes no arguments. Returns a new object.

$nav->open( [ $device ] )

Opens a new socket to the device.

$device The path to the device. Default: /dev/input/by-id/usb-3Dconnexion_SpaceNavigator-event-if00


Closes the socket.

$nav->update( [ $timeout ] )

Reads and parse event from device. $nav->update() will call open if the socket for some reason is closed.

$timeout Number of secounds $nav->update() should wait for a event from the device before returning.


Returns the value for the X axe. (3Dconnexion calls this for "Pan left/right")


Returns the value for the Y axe (Zoom).


Returns the value for the Z axe (Pan up/down).


Returns the value for the pitch (Tilt).


Returns the value for the roll.


Returns the value for yaw (spin).


Returns the state of the left button.


Returns the state of the right button.


Kay Bærulfsen, <kaysb@cpan.org>


'SpaceNavigator' is a trademark of 3Dconnexion.

Copyright (C) 2010 by Kay Bærulfsen, <kaysb@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.