Comments (6)
Hi, I just saw your comment.
It could be due to a keyboard mapping problem. Or even the specific keyboard type (hardware) you use.
I read that it is best to configure from the 'windows' side of things.
But, it might be good old 'CRLF' (\r\n) of windows versus 'LF' ('\n') of Unix and Mac.
Both are used to encode the <enter> key.
I tested this on Unix and Mac, but that is the '\n' situation. I would expect '\r' '\n' to be two bytes after each other, so the '\n' would always trigger <enter> but apparently this is not the case (in your case).
You could adapt line 190 of "install dir of"/grblhud/lineinput.py to:
if c == '\n' or c == '\r':
To find out the "install dir of" you can enter:
pip show grblhud
Let me know if that worked, because then I can update the program (I don't use windows systems, so I cannot test this).
Another possibility is to use another virtual machine to run Unix on. This might not have the issue. It might also be possible to configure the keyboard mapping of the virtual system (WSL2 or other).
Regards,
Johannes
from grblhud.
I tried it, but it did not work alas.
This is an Ubuntu install on WSL2, so it might not be that windows thing with the CRLF.
from grblhud.
Ok, I am a bit surprised. Keyboard remap isn’t an option?
I can give you a patch so you can see what character number it is when you press <enter>?
If you add the following line to "install dir of"/grblhud/unblockedgetch.py" (line 73, just before the return statement),
print(f"bytes: '\\x{c.hex().upper()}'", end = "")
(edit: updated this line!)
you get the hex code(s) of each key you enter. (You can find the install dir as mentioned in my first reply.)
I am very curious what you get when you run grblhud and push <enter>
Regards,
Johannes
P.S. you can also run a direct test on this module by entering:
python "install dir of"/grblhud/unblockedgetch.py
(type anykey - including <enter> - to get the hex code(s) for that key, end with 'z')
P.S.2 I did a test using python 3.12 on linux/arm (Manjaro) and it didn't work fine. See my comment below ...
from grblhud.
I'll make a fix for this problem. Point is that python 3.12.1 has a bug, it returns a 0x0D (CR) code instead a 0x0A (LF) code.
I'll also make a bug report for the python community (foundation).
The fix will handle CR and LF equally and is almost the same as the first patch I supplied:
You can add a class variable at line 33 and change line 191 of "install dir of"/grblhud/lineinput.py to:
LF = '\x0A' # or '\n'
if c == Input.LF or c == Input.CR:
print(Input.LF, end = '', flush=True)
This will do the trick.
from grblhud.
Created a python bug report for this issue: python/cpython#114328
pip install -U grblhud
This installs version 1.7.8 of grblhud and fixes the <enter> issue.
from grblhud.
Issue is fixed. Python bug will be fixed in a next release: python/cpython#114328
from grblhud.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grblhud.