kondrak/rust64

Backspace??

doyousketch2 opened this issue · 9 comments

If Backspace is used as Inst/Del, then what do we use as Backspace?
Arrows don't seem to control cursor keys, so I'm at a loss.

Inst/Del is the backspace key on the C64 as well so it should function in the exact same fashion. I just checked and it seems to work fine, the arrows also seem to work fine. What platform are you testing on and which Rust version?

I'm on Linux Mint Debian Edition.
rustc 1.18.0 (03fc9d622 2017-06-06)

Tried recompiling just now, and arrow keys are ok,
but backspace still doesn't do anything.
Maybe it's just this laptop screwing up. I'll try rebooting.

Think rust64's a cool project.
I saw they released source code for C64 kernal and whatnot.
https://github.com/mist64/cbmsrc
can glance at it if you want.

I wonder if the keycode / scancode is showing up as something else on my system.

It's a Logitech wireless MK320 keyboard.

If I swap these entries in io.rs

Key::Backspace => to_c64(0, 0),
Key::Delete => to_c64(6, 6),

Key::Backspace => to_c64(6, 6),
Key::Delete => to_c64(0, 0),

Then I can use Delete as if it were the backspace key,
but the Backspace key still doesn't do anything.

(expected what delete would have done, in the original case...)

KeyPress event, serial 37, synthetic NO, window 0x3c00001, root 0x8e, subw 0x0, time 3409376, (164,-13), root:(336,322), state 0x10, keycode 22 (keysym 0xff08, BackSpace), same_screen YES, XLookupString gives 1 bytes: (08) " XmbLookupString gives 1 bytes: (08) " XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3c00001, root 0x8e, subw 0x0, time 3409496, (164,-13), root:(336,322), state 0x10, keycode 22 (keysym 0xff08, BackSpace), same_screen YES, XLookupString gives 1 bytes: (08) " XFilterEvent returns: False

Maybe it's a capitalization issue?
I'm guessing Linux expects CamelCase spelling of BackSpace.

Casing is unlikely to be the cause since it's a custom type, I really don't think that's the problem. I have a laptop with Linux Mint at home, will check it out with your setup once I'm home.

Also, one more thing - key handling is done via this crate: https://crates.io/crates/minifb
Can you check it out and see if the backspace key works for you in a sample app? It's possible a different keycode needs to be returned on Linux.

emoon commented

Yeah this may be a bug in minifb

@doyousketch2 I bumped minifb to use the latest 0.9 version, previously it was fixed at 0.5 and it seems backspace was not handled on *nix at the time. Let me know if it works fine now!

Ty for looking into it. Was updating my system to Debian9, had 20 gig dedicated to root partition, and went past that. Botched the upgrade, So now I'm on my phone 'till I get another live USB installer. I'll assume you fixed it, 'cuz that sounds right.