Skip to content

Conversation

@kgmossey
Copy link

Currently, when typing Shift-2 on the C64 on MiSTer you'll get a double quote("), which is what you'd expect on an original C64. But if you press Shift-6 you'll get an up-arrow, not the & you'd expect from the layout map. Many other keys currently do not agree with the current layout map on the front page of the project.

This update allows the user to configure the keyboard between matching the original C64 keyboard as closely as is reasonable, or allows them to use a symbolic mapping, where pressing keys matches the special characters found on a modern keyboard. For example, pressing the [ key on the symbolic keyboard yields a [ as expected, but if it's the C64 original keyboard one would expect an @ symbol.

I've included two new keyboard mapping graphics and updated the readme.md file as well.

@sorgelig
Copy link
Member

So basically you throw away the mapping used on this core for many years? Don't you think it had its purpose to be that way?
What is the point to have map exactly as on original C64 keyboard on multi-core system? If you will connect original C64 keyboard to MiSTer, then you won't be able to use other computer cores (even you won't get F1/F11/F12 keys needed by MiSTer).
Original C64 keyboard is simply not suitable for MiSTer, so what is the purpose of that map?
Btw, symbolic keyboard actually called as PC keyboard by many ppl.

@kgmossey
Copy link
Author

I'm not trying to replace the current mapping completely, this is why there is the option to switch between the Commodore and PC layouts in the OSB menu. The current keyboard mapping graphic doesn't match the keys which is very frustrating for a new user of the core. In the original C64 keyboard, the SHIFT+2 should equal a double quote, and this is the current behavior of the keyboard, but SHIFT+6 through SHIFT+0 match up to a pc keyboard instead. I spent a significant amount of time hunting and pecking for keys trying to figure out where they mapped to the original.

The current mapping may have developer preference use cases, I am happy to discuss or just provide both.

For naming, I used the terms "Original" and "Symbolic" because original made more sense to me than the "Positional" term that VICE uses, but the "Symbolic" term purely comes from VICE. I am open to discussion about what to name the options. I'm also willing to discuss specific key mappings in places where they don't line up; If you think there is a better mapping, let's talk about it. I would actually be ok with calling it “Commodore” and “PC” and abandoning the “Original” and “Symbolic” altogether.

Separately, my project to create a fully functional USB C64 keyboard is unrelated to this core update. The keyboard admittedly has shortcomings, but nothing that can't be worked around. For example, the restore key is F11; F12 is the key combination CTRL + C= + INST/DEL as an homage to old DOS PCs.

I'm unsure what you mean by F1 not being available; that's a key on the original keyboard? Unless you mean F10 which my = maps to. F9 is the £ key, etc. Pressing the right shift and special keys sends the key without shift - so SHIFT+F2 on a PC keyboard would be accomplished by L SHIFT+R SHIFT+F1/F2.

If others want to follow suit and use an old C64 keyboard and case to fit to their MiSTer, awesome! Giving users the option to use the keyboard either as it was, or as something that completely maps to a modern keyboard, is an improvement in the usability of the core overall. Reception for this change has been positive from everyone I've spoken with on Discord; I hope you see the value in it, too.

@sorgelig
Copy link
Member

C64 keyboard has separate @ key. Move it to Shift-2 would mean removing a separate key which will obviously would affect games using that key. At the same time C64 has no " key. So have it on Shift-2 is logical way. Overall current mapping doesn't affect games. That small change in Shift+num keys doesn't affect games and at the same time gives easy access to often used symbols without confusion when you use PC keyboard. Some optional mapping (not default!) is fine, but current mapping shouldn't be touched.
I'm glad you made a special keyboard for your project, but MiSTer is targeted for off-the-shelf input devices, so any one can get it.

@kgmossey
Copy link
Author

There's a number of things you're missing here. First, this update is configurable - this means that it gives users the option of having a keymap configured either way. Have you talked to users about what they'd like to see? The users I've talked to are excited about this update. They do not understand the current layout, because quite frankly it does not make sense.

I understand that the C64 has a separate @ key, and I understand the intended rationale, but it's incomplete and inconsistent. The C64 has a separate * key as well, but you're perfectly willing to keep using shift-8 as an * instead of using it for another key. In order to get the special characters from either of those keys you still need to press other keys. All I've done in the PC layout is made the keyboard consistent. There is a " - it is a shift+'. The average user, if using a PC keyboard, is going to try pressing that to get the double quote. I have made the solution complete and consistent. Have you even tried the changes I've made or looked at the updated keymaps, or are you just dismissing them out of hand because you can, as the sole gatekeeper of this repo?

As it stands now, the keymap gif on the front page is wrong, leaving the new user to hunt and peck for the keys. It shows the 6 through 0 keys as matching the Commodore layout, which is not how it currently works. £ and ꜛ are switched. This leads to frustration on a new user and causes them to not want to use this core. Again, I've corrected all of these issues AND made it configurable to a user's preference. My change shouldn't affect games either, and it should reduce frustration and increase the usability of the core.

The C64 wasn't just a gaming computer, and I don't think that's going to be the use case of all the users. I think a large number would like to try their hand at programming it, either in BASIC or 6502 Assembler. In that case, the Commodore layout is probably going to be much more beneficial than the PC layout.

Finally not every user uses a qwerty keyboard, one user in particular I know of uses AZERTY and is really excited and optimistic that the commodore layout gets into the main core because it will make their life easier.

Try this update, it's available on discord. If you want I can upload the udated .rbf here so you don't have to compile it. Then decide if it makes sense or not.

@sorgelig
Copy link
Member

sorgelig commented Mar 27, 2022

  1. I'm the user of C64. And whole work i've made for this core is because i'm the user and i love C64. This is hobby project. I hate when people from nowhere come and straight jump on teaching me how to love C64 with a mentor tone.
  2. it has separate '*' key on ']', so can be used as a separate key. Also it has * on Shift-8 because that place wasn't occupied and compatible with PC keyboard.
  3. just need to update map's picture.
    Actually map was tweaked a little some time ago, but picture left untouched.
    As i've told above, it's ok to add additional original C64 map, but i don't want to change map for PC keyboard as it's carefully tweaked through the years for both gaming and programming.
    According to your changes, user have to switch between maps all the time as PC map isn't compatible with games since it removes separate commodore keys such as @,*,£, and C64 map too far from PC map to use it in apps. I'm as a C64 user find it very inconvenient. What single map did before now requires 2 maps. And btw, ScrLock shown on your map as keyboard mode won't work reliably as it also switches joystick emulation on HPS side.

@kgmossey
Copy link
Author

kgmossey commented Mar 28, 2022

  1. I'm glad you're a user of the C64, and I'm glad you use it because you love it, that's why I'm doing this too. I'm not coming from nowhere - I joined the discord and searched for places in the forums and on reddit where there was a forum that was appropriate to talk about this before I made the change. I couldn't find anywhere where this was discussed. I made it configurable so that it gives the user the most flexibility. And you've done fantastic work on it, don't read this as an attack on the core or your skills as a developer. But if you hate people you don't know jumping in and making improvements to your code, perhaps open source isn't where you should put your energy? This is literally the point of the open source world, is for people to come in and make changes they like. Blender has a huge ecosystem and process for getting involved - I'd be happy to work with all the senior devs to develop a process so stakeholders don't feel like their toes are being stepped on when users submit changes.

  2. This is where I feel like you're being inconsistent in the design and user experience philosophy. I've done some informal asking and several users have agreed with me that the current mapping doesn't make sense.

  3. Yes, you do need to update the map (I actually found the change in the code, but no documentation or discussion about it). In the future software changes and documentation changes should be released together.

"It removes separate commodore keys such as @,*,£, and C64 map too far from PC map to use it in apps." I'm confused as to how you are saying this. The special C= keys are still there on my PC map, why are you saying they're gone? Shift-8 is *, just as it is on the current mapping. The only keys that are different between my new PC mapping and the current one as it exists are as follows: (Using the PC unshifted key as the baseline reference here)

PC Keyboard Current behavior Modified PC layout behavior Notes
2 shifted " shifted @ Double quote is now over the ' key
6 shifted ' shifted up arrow Since ^ doesn't exist this key could go either way logically. I chose arbitrarily to follow the VICE mapping here.
= + and associated PETSCII characters unshifted =, shifted + + special commodore chars are now F10, replacing =. This is a mapping that could logically go either way, though I prefer the +/= behavior because it seems more consistent with the consistent philosophy I've tried to follow of copying the PC layout where possible
[ unshifted @ unshifted [ Shift and C= key have same behavior for PETSCII chars as current mapping, can get @ symbol from shift 2
] unshifted * unshifted ] Shift and C= key have same behavior for PETSCII chars as current mapping, can get * symbol from shift 8, which is aligned with the current map anyway
; unshifted :, shifted [ unshifted ;, shifted : [ and ] are their own unshifted keys on the keyboard
' unshifted ;, shifted ] unshifted ', shifted " These keys do not have special C= PETSCII characters
F10 = + key and associated PETSCII characters As said above this mapping could go either way.
Tab C= CTRL Another mapping that can go either way. Happy to put this back to C=

And the following special keys are completely unchanged from the current mapping: F9 acting as up arrow, F11, F12, shift {7,8,9,0}, \ acting as £, comma, period, /, and all the special shift and C= keys (except =/F10). F9 and \ are updated on the new mapping graphic but function the same as they currently do.

So only 9 changed keys, of which 3 I'm willing to swap back to their current behavior without debate. I don't believe with my mapping users would have to switch back and forth during games, but if you know of any games where this might be the case, please let me know. As it is though, users DO have to switch between Joy 1 and 2 for different games through the OSD menu, and I have no idea how to make that functionality smoother.

The Scoll Lock on my map is there because that's how it works. It says "kbd mode" not "kbd config", and in the documentation immediately above the layout it literally says "Toggle between keyboard mode acting as keyboard, mouse, Joy 1, or Joy 2". I am happy to change that verbage to something else, but I did not change the function of the Scroll Lock key at all. It still does what it did before. Again, I'm happy to change the wording - I want this do be as clear and understandable as possible. Something like "Joy emul" for example might be better?

@sorgelig
Copy link
Member

sorgelig commented Mar 28, 2022

  1. But if you hate people you don't know jumping in and making improvements to your code, perhaps open source isn't where you should put your energy?

The key point is that i don't treat it as improvement. So your logic about me is completely wrong. Improvements are welcome and i've accepted many PRs. Open source doesn't automatically means every next developer should cancel previous developer work. You came here to show that only you know how mapping should look, completely disregarding my explanation of reasons why mapping is like this. So before tell me what is right for me better if you will look at yourself? If you are so uncompromising (i've offered you to add just additional C64 map without touching PC map) then probably collaboration isn't yours.

Either i don't understand you, or you don't understand me.. In my mapping commodore keys @ and * are present. In your PC mapping they aren't. They moved to shifted positions which is completely different behavior. Games (and apps too, btw) get raw key states and they expect specific key press without involving Shift. Also i don't like to play game where one of these keys are used, so i have to press Shift which will affect other keys too if several keys must be pressed.
I have ported/created many computer cores and when it comes to keyboard map i have quite experience how to make it right and more compatible with original keyboard.

@kgmossey
Copy link
Author

kgmossey commented Mar 28, 2022

Sorge, let me tell you my day job. I'm an airline pilot. I fly human beings around in a tube of aluminum, and our goal is to land safely every time. At the end of each flight both pilots do a debrief asking what we did well and what we could improve upon. We discuss any mistakes we made, no matter how minor, to constantly improve. It is literally part of my job to accept criticism and admit where I am wrong, because peoples lives are in my hands. It is also my job to point out where someone else is wrong though. And no, you do not have to accept every change, I'm free to fork the project and just go on my merry way. But you will have to accept that people will put up pull requests and have suggestions, which is what you said you hate.

You keep falling back on "But my mapping has these keys! Yours doesn't!" My solution is following a consistent design philosophy - either positional mapping of commodore keys or symbolic mapping of PC keys. If all you will accept is a Commodore original layout, then I will have to accept that, because I know several users want that implemented, but I ask you actually poll users and see what they think about the mapping as it exists. Also, there is a solution to the point you keep talking about - if you want a hard keypress for @ and * there is space for them inside of my solution. Currently F9 and Pg Dn both act as up arrow while F10, =, and End act as = and +. Leaving = as =/+ we can compromise and still have a key that sends the actual keypress to the MiSTer. Either F9 and F10 act as @ and * or End and Pg Dn could. And + and up arrow would have their own keys still.

If that is acceptable I'll happily make the change to those keys, whichever way you think is best. That way we truly improve the solution. And both the Commodore and PC layouts are consistent and useful. I'll even make the PC layout the default if you prefer. (My next goal has been to figure out how to get these settings loaded from the config file anyway...) I'll even prep the reversion to be configurable to the current mapping and a commodore layout in case users revolt with the modified PC layout.

@kgmossey
Copy link
Author

Here's a proposed updated keyboard mapping. It has a dedicated key for all the C= keys to address your concerns about games, as well as following the design philosophy of matching the PC keys to their C= equivalent.

keymap_pc_rev_2 0

@sorgelig
Copy link
Member

sorgelig commented Mar 28, 2022

Believe me, not only pilots gets criticism on their job. Hope you like your job but mentioning it here is quite redundant and irrelevant to topic.

Probably you think i just spontaneously created current mapping, right?
Basically all your suggestions above were passed through my own thinking and discussion with other people. And current mapping is most optimal and compatible with different keyboards. Believe me, current mapping went through many iterations and optimizations to fit by several reasons. You're pursuing only single reason - fit into PC keyboard marking.
You recent suggestion has several flaws:

  1. not all keyboards are full sized PC keyboards. Many keyboards don't have editorial block, so it will be hard to use reduced keyboards as it will involve Fn+key combo. Imagine someone (me, for example) embedded MiSTer into Amiga 1200 case. Amiga keyboard uses reduced editorial block.
  2. this map relocates keys making not more useful as current map since you have to learn some keys anyway.

Generally speaking, it's not hard to remember several relocated keys on current map if you use C64 core often. I've learned them quickly. As an additional hint, it's not hard to add additional labels on keyboard. There are many such services providing painted or engraved marks to keys.

I'm still fine to add original C64 keyboard map as an option if you want, but your PC map suggestions are worse than current one.

@BluesM18A1
Copy link

BluesM18A1 commented Nov 12, 2023

For what it's worth, I find the current default layout to be a very useful compromise for at least the US keyboard layout. I wouldn't want to remove it either, but having the option of these two new layouts in addition to it also can't hurt anyone. I especially find the "commodore" layout useful, because the modern Japanese 106/109 key layout is very close to the Commodore keyboard layout in many ways. Ergo, I could plug in a Japanese keyboard and have the best of both worlds, the position of each key matching the Commodore keyboard closely enough without having many of the key labels be misleading.

@AfterBurnett
Copy link

This would be really helpful for me. Long time C64 fan but I can't remember where all the keys are so mapping them to the PC keyboard would be a great option - it's in every emulator. Obviously it should only be an option...

@Jammmmm
Copy link

Jammmmm commented Feb 17, 2024

I'm also inclined to agree with this. Being able to switch between a C64 layout and a regular PC keyboard layout would be ideal.

I'm able to type LOAD"*",8,1 because my muscle memory tells me where the " and * are, but if a game asked me to hit the = key, I will have no idea because it's not a key I used often on the C64.

This sort of option should be available for any cores that make use of the keyboard. For example, I'm looking at the keyboard layout for an Amstrad CPC 464. I never used one back in the day. If I'm asked to press * I'm not going to be able to find it. It's not in the PC or C64 position.

@bootsector
Copy link

Today I tried to teach my 6y/o daughter some C64 BASIC and we got a little frustrated because typing “ or + on an US keyboard didn’t produce the same characters on the screen.

I think that having the option proposed by this PR would be so valuable for some use cases.

Hope this is considered to be merged/implemented on this core (and maybe other computer cores) in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants