Stupid noob question

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
idcsteve
Posts: 8
Joined: Wed Nov 05, 2008 11:52 am

Stupid noob question

Post by idcsteve »

Hi,

I'm trying to use the spaceball 5000 as a 3D mouse in C#. I'm moving the cursor just fine, but I need to be able to click. For some reason, I can't get keyboard feedback at all.

Do I need to configure the control panel to "Button 1, Button 2 etc" then do something else?

I've even tried assigning a button to the spacebar, escape or tab and listening for qwerty keyboard input, but that's not working either.

Some strange things:
When I press the button assigned to tab or escape when using a normal application, they work just like that key. When I use the spacebar button nothing happens.

I'm using the TDconnexion namespace from the NASA Wildwind demo, along with the following code:

Code: Select all

TDconnexion.TDxDeviceWrapper m_TheInputDevice;
        public static TDconnexion.I3DxSensor m_TheSensor;
        TDconnexion.TDxSensorInputEvent m_SensorEventHandler;
        static TDconnexion.I3DxKeyboard m_TheKeyBoard;
        TDconnexion.TDxKeyboardEvent m_KeyUpEventHandler, m_KeyDownEventHandler, m_KeyEventHandler;

        public delegate void SensorEvent(double x, double y, double z);

        private static SensorEvent m_SensorEvent;

        private static Connection instance = new Connection();

        private Connection()
        {
            m_TheInputDevice = new TDconnexion.TDxDeviceWrapper();
            if (m_TheInputDevice != null)
            {
                m_TheSensor = m_TheInputDevice.Sensor;
                m_SensorEventHandler = new TDconnexion.TDxSensorInputEvent(NotifySensor);
                m_TheSensor.SensorInput += m_SensorEventHandler;
                
                m_TheKeyBoard = m_TheInputDevice.Keyboard;
                m_KeyUpEventHandler = new TDconnexion.TDxKeyboardEvent(NotifyKeyboardUp);
                m_TheKeyBoard.KeyboardEventUP += m_KeyUpEventHandler;

               
                m_KeyDownEventHandler = new TDconnexion.TDxKeyboardEvent(NotifyKeyboardDown);
                m_TheKeyBoard.KeyboardEventDOWN += m_KeyDownEventHandler;
                m_TheInputDevice.Connect();
            }
        }

        private static void NotifySensor()
        {
            C3DxVector v = m_TheSensor.Translation as TDconnexion.C3DxVector;
            m_SensorEvent(v.X, v.Y, v.Z);
        }

        

        private static void NotifyKeyboardUp(Int32 nKey_p)
        {
           
        }

        private static void NotifyKeyboardDown(Int32 nKey_p)
        {

        }

        public static SensorEvent SensorEventHandler
        {
            get
            {
                return m_SensorEvent;
            }
            set
            {
                m_SensorEvent = value;
            }
        }
I hope I'm just doing something stupid
idcsteve
Posts: 8
Joined: Wed Nov 05, 2008 11:52 am

Post by idcsteve »

I went to use it again and the buttons had mysteriously reset to defaults. When I reconfigured them to the spacebar, the keyboard input in my c# app started working as expected. Any idea why?
idcsteve
Posts: 8
Joined: Wed Nov 05, 2008 11:52 am

Post by idcsteve »

:oops: :oops: :oops:

I tweaked my nicotine/caffiene balance and now I've figured it out.

You know how the standard answer is RTFM? Well I tried. And once I'd opened Adobe, I was only changing the button configurations for that. Now I feel like a right idiot.

Can you guys delete this thread so I can fade back in to obscurity?

Thanks.
ngomes
Moderator
Moderator
Posts: 3365
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Hi idcsteve,
Can you guys delete this thread so I can fade back in to obscurity
We can but what would be the fun in that? ;)

Seriously, we do not think this a "stupid noob question". The concept of configuration -- that you very quickly figured it out -- does not always comes natural to people. We think the post may help others developers.

Let us know how your development is progressing. It is quite something for us when we see new apps or solutions coming up for our products.

I've the topic to the "developers" forum.
Nuno Gomes
Post Reply