barrettford/Octoprint-Usb_keyboard

How to set a variable with a key?

Mazvy opened this issue · 2 comments

Mazvy commented

I'm a bit confused on how setting variables works.

I want to have keys 1, 2, 3, 4 be dedicated to controlling a variable. Press 1 - variable is set to X, press 2 - variable set to Y, etc.

Use case - instead of using the method in the 10key example for setting the movement distance, I want dedicated buttons to do so. It's just easier for me to track what's going on as there is no visual feedback to what the value is set. I'd rather press the 10mm button and afterwards I know that all my movement keys will result in that value.

Edit: nevermind, I just copied this and it works #24 (comment)

Yeah, I wasn't very clear on that...

Mazvy commented

Yeah, I wasn't very clear on that...

I would personally find the addition immensely useful of having a set_var option on press/release. I understand the logic of why you've implemented the variables this way, but this wouldn't take anything away from that.

Also, perhaps also a way to increment variables? It does become tricky, but having an Increase speed by +100 button button would be very welcome.

Regardless, great plugin! I'm using Klipper for plotting and you won't believe how easy this makes the entire workflow. If now I could only figure out why numpad enter crashes the entire linux system ....