Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad / Keyboard Shortcuts #20

Closed
sharmstr opened this issue Oct 25, 2018 · 22 comments
Closed

Gamepad / Keyboard Shortcuts #20

sharmstr opened this issue Oct 25, 2018 · 22 comments

Comments

@sharmstr
Copy link
Collaborator

Just a suggestion to add keyboard shortcuts for a few things like start, pause and abort.

@zirkeltraining
Copy link

and, obviously, for x/y/z movements (shift to move x10 units)

@petervanderwalt
Copy link
Contributor

petervanderwalt commented Nov 26, 2018

Opening discussion for key combinations... What do you want to press to do what etc (:

Functions - Not all of them are really appropriate for Keyboard bindings, but consider this a template - will give it a couple weeks to gather suggestions so we see if a pattern emerges so whatever we decide on is intuitive:
Start/Play =
Pause =
Stop/Abort =
Soft E-Stop =
Jog (X) =
Jog (Y) =
Jog (Z) =
Jog Size+ =
Jog Size- =
Feed Override+10% =
Feed Override-10% =
Spindle Override+10% =
Spindle Override-10% =
Setzero X =
Setzero Y =
Setzero Z =
Setzero XYZ =

@sharmstr
Copy link
Collaborator Author

Start = Alt + R
Pause = Spacebar
Stop = Esc
Jog x = left and right arrows
Jog y = up and down arrows
jog z = page up and page down

@petervanderwalt
Copy link
Contributor

Thoughts on Gamepad vs Keyboard?
(Gamepads have a more standardised layout, makes easier to learn)

@sharmstr
Copy link
Collaborator Author

Are the gamepads basically just keyboard emulators? You map a button on the gamepad to a key (or combination of keys)?

@petervanderwalt
Copy link
Contributor

petervanderwalt commented Jan 16, 2019

Not entirely: see https://w3c.github.io/gamepad/#remapping - its a standardised input (so there are canonical standards as to what the events report, so without having to need a complex mapping procedure, the "standard" api will know your gamepad's UP Dpad, is same as my UP Dpad, etc. The point you are heading too (Just make it all customizable) is great, but doesnt align with the goals of this project. You'll notice there is no "settings" button in CONTROL for a reason, it should 100% be plug and play, no setup required. (Grbl Settings doesnt count because we have to setup the firmware, but still, no setup to the application itself needed)

Whats nice about Gamepad vs Keyboard is that I can take exclusive control of a gamepad (and read inputs whether the window is in focus or not) but with Keyboard, you need to be aware of other applications listening for the same events, and the window has to be "in focus" or active before the events get fired.

@petervanderwalt
Copy link
Contributor

Perhaps I should spin up a demo to play with to convince you guys (;

@sharmstr
Copy link
Collaborator Author

Thank you for the explanation. It sounds like the gamepad fits your vision and they are cheap enough.

@petervanderwalt petervanderwalt changed the title Keyboard Shortcuts Gamepad / Keyboard Shortcuts Jan 22, 2019
@petervanderwalt
Copy link
Contributor

petervanderwalt commented Jan 22, 2019

Continous Jog skeleton code

var curvalue = 0; // set externally from websocket
var direction = X- // X-, X, Y-, Y, Z-, Z // set externally from websocket

setInterval(function() {
  if (curvalue > 10) {
    if (!blocked) {
      console.log("$J=G91 G21 " + direction + "1 F" + curvalue * 4 + "\n")
      port.write("$J=G91 G21 " + direction + "1 F" + curvalue * 4 + "\n");
      blocked = true;
    }
  } else {
    port.write(String.fromCharCode(0x85));
    // console.log("STOP ")
  }
}, 20);

Dug up the old code from +-8 months ago - got reminded of it by @swarfer in the forum, remembered I wrote it already. Posting here so I dont forget where it is again

@mobilemcclintic
Copy link

In staying "plug and play" with the software, I'd like to see a customizable binding menu, but default it to standardish settings. I'm just me, but I would be thinking along the lines of the below. Personally the best feature that keeps me coming back to Open Builds control is the troubleshooting tab and the axis steps/mm adjustment function.

Start/Play = Default to nothing, bindable (I don't have an idea)
Pause = Default to nothing, bindable (I don't have an idea)
Stop/Abort = Default to nothing, bindable
Soft E-Stop = Default to nothing, bindable
Jog (X) = Left Joystick, keypad 2/8
Jog (Y) = Left Joystick, keypad 4/6
Jog (Z) = Right Joystick, keypad 3/9
Jog Size+ = Right trigger button / keypad "-"
Jog Size- = Left trigger button / keypad "+"
Feed Override+10% = controller directional pad Up
Feed Override-10% = controller directional pad Down
Spindle Override+10% = controller directional pad Left
Spindle Override-10% = controller directional pad Right
Setzero X = Default to nothing, bindable (Nice to have, but if not intuitive could mess things up)
Setzero Y = Default to nothing, bindable (Nice to have, but if not intuitive could mess things up)
Setzero Z = Default to nothing, bindable (Nice to have, but if not intuitive could mess things up)
Setzero XYZ = Default to nothing, bindable (Nice to have, but if not intuitive could mess things up)

@stevemayathome
Copy link

I'm Partial to seeing left arrow -X right arrow +X, up arrow +Y down arrow -Y
with the page up +Z page down -Z
But
How do I hookup a game pad to my pc, this sounds good too.
just my nickel's worth (we don't have penny's anymore)

@jbhurst
Copy link

jbhurst commented Apr 12, 2019

I think you can stick with "plug and play" goal and still offer some customization for advanced users without forcing them to fork. One way would be to define standard shortcuts, but have them editable in a JSON, but not readily exposed through menus. Since so many games do this, including games in Python, there is probably some open binding code you could pillage. Sorry, I don't know of any off hand though.

Having custom bindings also would help a lot to enable customers that want a custom controller. I've thought about buying one of the programmable game or CAD/CAM controllers with OLED screens and configuring it to run a CNC and execute certain standard macros.

@petervanderwalt
Copy link
Contributor

keybshort

(; this might just be in 1.0.153 or later (;

petervanderwalt added a commit that referenced this issue Apr 16, 2019
@petervanderwalt
Copy link
Contributor

consider the initial release just a beta, more features will be added and it will still get prettier and fancier, just getting the basics out there for some user testing

@stevemayathome
Copy link

That looks like a great start, only question is when. Please don't keep us hanging. I like the customizability aspect.

@petervanderwalt
Copy link
Contributor

v1.0.156 is out!

Bonus! Also now supports Continuous Jogging (Hold down mouse or keyboard button to jog. Longer you hold, further it goes!. Lift off button and it stops (with deceleration) - consider this part of the feature a little beta for now

continous jog

And then of course: here's the Keyboard setup (some defaults preconfigured)
keys

Closing for now!

@stevemayathome
Copy link

Just downloaded and tried out. What took you so long (trying to be funny)
only problem I had was with my anti virus program. It wanted to send it away for analysis. I said yes but let it go right now. So AVG should have it on file now. It works great and is intuitive. Cute the way you flash the lights when moving. Well done !! Thanks

@petervanderwalt petervanderwalt moved this from Planned Feature: Driver to Completed in OpenBuilds CAM and CONTROL Apr 18, 2019
@petervanderwalt
Copy link
Contributor

Sorry to hear about your AV.
We have bought some Microsoft Autheticode Certificates will be adding that to the build process soon. Not to hijack this issue, but does your AV show why it reacts that way? (New issue please)

@stevemayathome
Copy link

hi;
I'm running win10 with latest updates, the antivirus is AVG with it's latest updates.

I did let my Windows Defender Firewall know to let the program go through.

Typically when I load a new program (or as well as any previous releases of OpenBuilds Control) the AV will pop up and do a 10 - 15 second scan of the program.

This time it did the 10 - 15 second search then it came back with a " we haven't seen this before can we send it to them so that they could look at it more deeply for about 52 seconds. ( why 52 I don't know)

It wouldn't allow me to say no and install it anyway.

So I cancelled the install, opened the AV control panel and changed configuration so that I control what is allowed. ( sounds like the old Norton stuff I used to fight with )

I then restarted the install and after the first 10 -15 second check it came up and asked again but also had the option to go ahead anyway, as well as sending them the file to look at.

I expect that they want to check it and allow it in future checks. That's just a guess on my part.

Anything else I can help with just ask.

Thx Steve

@petervanderwalt
Copy link
Contributor

petervanderwalt commented Apr 18, 2019 via email

@jbhurst
Copy link

jbhurst commented Apr 19, 2019

This is great! Thanks!

@sharmstr
Copy link
Collaborator Author

Can you add feed and tool override as well?

rlwoodjr referenced this issue in rlwoodjr/Basic-SENDER Feb 1, 2022
Add override menu to the ribbon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

6 participants