MiSTer-devel / ZX-Spectrum_MISTer

45 stars 33 forks source link

Update keyboard.sv #11

Closed adrianlongland closed 3 years ago

adrianlongland commented 3 years ago

Fixes keys such as "<," which does not give "<" when shift is pressed - this vastly improves recreated spectrum keyboard in Qwerty mode by enabling " to be typed. Fixes rapid cursor left/right giving 5s and 8s. Fixes switching shift keys losing caps. eg. left shift down, a down, right shift down, left shift up, a down - giving "Aa".

adrianlongland commented 3 years ago

The issue with the < > - + keys etc. was that the CAPS SHIFT key was not being cleared when the fake SYMBOL SHIFT was being introduced. None of the extra keys such as + that had been coded were working.

The quote character ( " ) had been coded to appear without the shift - the ~shift cases were switched - so for that key ' was inaccessible. The two issues together meant " was still accessible.

The change will mean pressing 0x52 ( " ' ) on its own will now bring up ' . Before it would bring up ". Now you have to press shift and 0x52. I think this was the original intent but it's worth noting this is a change in behavior.

I moved the management of CAPS SHIFT and SYMBOL SHIFT into its own block. I also added regs to track the left shift and right control. This allows CAPS SHIFT or SYMBOL SHIFT to stay down on the spectrum side when the ps2 keys change.

sorgelig commented 3 years ago

I think it's better to keep " without shift as 99% users only need to load the game, so typing LOAD"" is faster without shift.

adrianlongland commented 3 years ago

Backed out recreated keyboard. Restored shift key fixes. Swapped ' and ".

adrianlongland commented 3 years ago

Just noticed I broke CTRL and SHIFT going into E cursor / extended. Working on fix.