kevinawalsh / logisim-evolution

Digital logic designer and simulator
GNU General Public License v3.0
113 stars 17 forks source link

Bug: Keyboard Doesn't Output Backspace Character #77

Open TChapman500 opened 3 years ago

TChapman500 commented 3 years ago

For some reason, the keyboard isn't sending the backspace character out onto the databus. It's instead erasing the character that came before it. I need that backspace character. And on a related note, I need the TTY to be able to respond to the backspace character being sent to it.

kevinawalsh commented 3 years ago

Yes, that's right. The simulated keyboard component has some built-in character handling. It buffers characters, and it also processes the backspace, delete, left, right, home, and end keys, to edit the current buffer. One issue is the current Keyboard component outputs ascii, not ps2 key codes. While there is ascii for DEL and \b, there is no ascii for left, right, home, end, etc.

If you take a look in std/io/Keyboard.java you will see the keyPressed() processing. It would be straightforward to add an option to the Keyboard component for "raw input", to disable the buffering. But perhaps a better approach would be to split the current keyboard feature into two pieces: a virtual on-screen keyboard (that looks like a keyboard, and could be poked with mouse/touch as well as key presses, and which outputs raw key codes (or maybe even ps2 key code sequences); and a separate keyboard buffer that can buffer characters and (optionally, I suppose) provide buffer-editing capabilities. That would make the FPGA implementation more flexible too. That's a bigger project though.

On Mon, Feb 15, 2021 at 2:01 PM Timothy Chapman notifications@github.com wrote:

For some reason, the keyboard isn't sending the backspace character out onto the databus. It's instead erasing the character that came before it. I need that backspace character. And on a related note, I need the TTY to be able to respond to the backspace character being sent to it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kevinawalsh/logisim-evolution/issues/77, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4J3ARMSQ54EINBEJMZRHLS7FVONANCNFSM4XVFKORQ .