Using AGOpenGPS with a joystick

Thanks for sharing and the nice documentation.

Nice job!

Is there a list for all AOG shortcuts ? Maybe add it to manual ?

1 Like

The normal shortcuts build into AGOpen are the following

A= Autosteer on/off
C= Open Steer Chart
V= open Vehicle Settings
N= Auto section on/off
Numpad1= Auto section on/off (both do the same)
M= Manual Section On/Off (or mark the applied area)
Numpad0= Manual section on/off (both do the same)
G= Set Flag
P= snap to pivot (sets the AB Line to your position)
F11= Full screen

There are other hotkeys in the code but they are for simulator use

2 Likes

Would bei very nice to implement the shortcuts over UDP PGNs as well.
=> + External button-panel for small screens, or important Buttons on armrest,…
=> + Switching things even Düring an other window ist opend (e.g.Explorer) when HID driver would not be working correctly.

4 Likes

Working on this


4 Likes

What about cheap Bluetooth remote option like this?

3 Likes

Nice, is it 3d Print?

Yea. it’s for 3D print.

1 Like

maybe you can design just a cradle for the Bluetooth stick. I like the idea of wireless in this particular case…

2 Likes

Can it be shared?

Not easy without measures

1 Like

Joystick v2.zip.txt (706,2 KB)

Remove .txt extension

3 Likes

Salut tu as la liste des autres raccourcis ? Merci

Salut
Bonjour
Je viens de coller le code entier ici pour faciliter les choses.

//keystrokes for easy and quick startup
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            //reset Sim
            if (keyData == Keys.L)
            {
                btnResetSim.PerformClick();
                return true;
            }

            //speed up
            if (keyData == Keys.Up)
            {
                if (sim.stepDistance < 0.04 && sim.stepDistance > -0.04) sim.stepDistance += 0.002;
                else sim.stepDistance += 0.02;
                if (sim.stepDistance > 1.9) sim.stepDistance = 1.9;
                hsbarStepDistance.Value = (int)(sim.stepDistance * 5 * fixUpdateHz);
                return true;
            }

            //slow down
            if (keyData == Keys.Down)
            {
                if (sim.stepDistance < 0.04 && sim.stepDistance > -0.04) sim.stepDistance -= 0.002;
                else sim.stepDistance -= 0.02;
                if (sim.stepDistance < -0.35) sim.stepDistance = -0.35;
                hsbarStepDistance.Value = (int)(sim.stepDistance * 5 * fixUpdateHz);
                return true;
            }

            //Stop
            if (keyData == Keys.OemPeriod)
            {
                sim.stepDistance = 0;
                hsbarStepDistance.Value = 0;
                return true;
            }

            //turn right
            if (keyData == Keys.Right)
            {
                sim.steerAngle += 2;
                if (sim.steerAngle > 40) sim.steerAngle = 40;
                if (sim.steerAngle < -40) sim.steerAngle = -40;
                sim.steerAngleScrollBar = sim.steerAngle;
                btnResetSteerAngle.Text = sim.steerAngle.ToString();
                hsbarSteerAngle.Value = (int)(10 * sim.steerAngle) + 400;
                return true;
            }

            //turn left
            if (keyData == Keys.Left)
            {
                sim.steerAngle -= 2;
                if (sim.steerAngle > 40) sim.steerAngle = 40;
                if (sim.steerAngle < -40) sim.steerAngle = -40;
                sim.steerAngleScrollBar = sim.steerAngle;
                btnResetSteerAngle.Text = sim.steerAngle.ToString();
                hsbarSteerAngle.Value = (int)(10 * sim.steerAngle) + 400;
                return true;
            }

            //zero steering
            if (keyData == Keys.OemQuestion)
            {
                sim.steerAngle = 0.0;
                sim.steerAngleScrollBar = sim.steerAngle;
                btnResetSteerAngle.Text = sim.steerAngle.ToString();
                hsbarSteerAngle.Value = (int)(10 * sim.steerAngle) + 400;
                return true;
            }

            if (keyData == (Keys.F))
            {
                CloseCurrentJob();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.A)) //autosteer button on off
            {
                btnAutoSteer.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            //if (keyData == (Keys.S)) //open the steer chart
            //{
            //    toolstripAutoSteerConfig.PerformClick();
            //    return true;    // indicate that you handled this keystroke
            //}

            //if (keyData == (Keys.S)) //open the steer chart
            //{
            //    btnSnapToPivot.PerformClick();
            //    return true;    // indicate that you handled this keystroke
            //}

            if (keyData == (Keys.C)) //open the steer chart
            {
                steerChartStripMenu.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.V)) //open the vehicle Settings
            {
                //lblHz.Per.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.NumPad1)) //auto section on off
            {
                btnSectionOffAutoOn.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.N)) //auto section on off
            {
                btnSectionOffAutoOn.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.NumPad0)) //auto section on off
            {
                btnManualOffOn.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.M)) //auto section on off
            {
                btnManualOffOn.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.G)) // Flag click
            {
                btnFlag.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.P)) // Snap/Prioritu click
            {
                btnSnapToPivot.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            if (keyData == (Keys.F11)) // Full Screen click
            {
                btnMaximizeMainForm.PerformClick();
                return true;    // indicate that you handled this keystroke
            }

            // Call the base class
            return base.ProcessCmdKey(ref msg, keyData);
        }
        #endregion

Merci
en fait je voulais savoir si tu avais les autres ceux du mode simulateur

Il y a d’autres touches de raccourci dans le code, mais elles sont destinées à une utilisation en simulateur.

J’ai remarqué cela après avoir posté le message, j’ai donc modifié le message pour qu’il inclue également les commandes du simulateur. :sweat_smile:

2 Likes

Can we stay with English please. Or at least copy Google translate underneath. Thanks!

Does someone know how to publish the modified code?
So i mean i can change the UDPComm… file but how to go on than?

Click build AgOpengps in build section if it is successful click publish then install and copy .exe to existing aog install. Not ideal but it works.

Switch from debug to release.

Hello, maybe also usefull:

        // AB-Line aktivate

        if (keyData == (Keys.K))
        {
            btnABLine.PerformClick();
            return true;    // indicate that you handled this keystroke
        }

        // AB-Curve aktivate

        if (keyData == (Keys.I))
        {
            btnCurve.PerformClick();
            return true;    // indicate that you handled this keystroke
        }

Does someone know how to implement:

  1. U-turn Left / Uturn Right button

  2. Drive in

         // drive in
    
         if (keyData == (Keys.E))
         {
             btnInField_Click.PerformClick();
             return true;    // indicate that you handled this keystroke
         }
    

btnInField_Click.PerformanceClick() does not work:
Failure: btnInField_Click is not declarted