gerritv / Grbl-Panel

A control panel for Grbl
MIT License
180 stars 102 forks source link

Create Jogging #131

Open PatrikRindlisbacher opened 6 years ago

PatrikRindlisbacher commented 6 years ago

suggestion Jog with Keybard

--> After keyup, the machine stops immediately !!

Approach / suggestion / idea

Private Sub GrblGui_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
    Select Case e.KeyData
        Case Keys.Left
            Me.btnHold.PerformClick()
        Case Keys.Right
            Me.btnHold.PerformClick()
        Case Keys.Up
            Me.btnHold.PerformClick()
        Case Keys.Down
            Me.btnHold.PerformClick()
        Case Keys.PageUp
            Me.btnHold.PerformClick()
        Case Keys.PageDown
            Me.btnHold.PerformClick()
    End Select
End Sub

Thanks for checking

Patrik Rindlisbacher

gerritv commented 6 years ago

I will try this out in the next week. One question though, what do you want to happen with the queued commands after the Hold is sent? I would think a Reset should be issued to clear the buffer to avoid further movement if the Hold is released.

1Metalguru commented 6 years ago

This is a great idea. I know it is very difficult to use the keys to jog because, I am assuming, the key down commands accumulate very fast in the buffer and the machine keeps on moving well after the key is released. This makes it very likely that the machine will crash into the end stops unintentionally. You have to be very careful using the keys to jog instead of the on-screen buttons.

MG

PatrikRindlisbacher commented 6 years ago

Hi Gerrit The code works great to drive with the buttons. So far, it has always stopped perfectly with no glitches and no reset. :-)

PatrikRindlisbacher commented 5 years ago

Summer is over. I'm back in the workshop, too. I will also try to improve on the code. :-)