Page 1 of 2

Symbolic keyboard map for XVIC - Italian

Posted: Mon Jan 29, 2018 2:34 am
by LoadError
Any chance of finding a working win_sym_it.vkm file to use in VICE XVIC?
The one provided in the X64 folder does not work with XVIC for some reason.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Mon Jan 29, 2018 7:42 pm
by CurtisP
The reason it doesn't work is because the VIC-20 and C64 use slightly different keyboard matrixes.

Does the C64 one work with x64? If so, it shouldn't be too difficult to convert it to work with xVic.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Wed Jan 31, 2018 6:33 am
by LoadError
Is this documented anywhere? I guess I'd have to replace the four digit number at the beginning of each directive.

Examples:
2 0 0 8 /* 1 -> 1 */
3 0 7 40 /* 2 -> 2 */

According to the commented lines in the file itself, the syntax is supposed to be this:
- normal line has 'keysym/scancode row column shiftflag'

So in the examples above, the "1" key should be in row 0, column 0, shift flag 8 (which means "can be shifted or not shifted"); the "2" key should be row 0, column 7, and the shift flag 40 does not match any of the documented flags. So definitely something does not add up.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Fri Feb 16, 2018 7:05 am
by orion70
I noticed your post in the International section just yesterday, and this post a couple of minutes ago :oops:
I also fiddled with the symbolic IT keyboard matrix for X64, and tried to adapt it into a new win_sym_it.vkm for XVIC, with no success. Looks like I always mess the whole keyboard up, and loose almost all but the alphabet keys (no punctuation etc.). Now, Google wasn't my friend in finding a working sym_IT dor the VIC emulator, so I guess it should be submitted as a request to the VICE team.

At least, in all this mess, I learned how to make my X64 correctly respond to my Italian keyboard. So thanks Loaderror :).

EDIT: a good start could be to "Dump keyset" in the Keyboard menu. It creates a vkm file with the correct VIC matrix, but empty (no assigned keys whatsoever). I am not able to get past this point though.

EDIT2: as I can see here (page in Italian), this is pretty useless, as it dumps the present configuration, i.e., the US symbolic keyboard. The rest between the two "/" symbols is a comment.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Fri Feb 16, 2018 7:42 am
by orion70
And here we go, I found this pretty badly shaped keyboard matrix in an archived copy of the VIC Technical Manual. I hope it can be of use, even if it's not so readable (click to enlarge).

Re: Symbolic keyboard map for XVIC - Italian

Posted: Sat Feb 17, 2018 2:20 am
by srowe
Here's a better one from "VIC Revealed"
keymatrix.png

Re: Symbolic keyboard map for XVIC - Italian

Posted: Sat Feb 17, 2018 3:53 am
by LoadError
I still can't make head or tail about it :oops:
How does this scheme translate to a VICE keymap file?
It's particularly the third code (the shiftflag) that's eluding me.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Sat Feb 17, 2018 6:10 am
by LoadError
Success! I've got it figured out.
The first thing to understand is that the shift codes are cumulative.
The second thing is that shiftcode "40" means "the key can be shifted" (8) + "another definition for the same key will follow" (32).
With this in mind, I've been able to map the "3" key correctly on an Italian keyboard (unshifted = "3"; shifted = "£").

4 1 0 40
4 6 0 0
42 1 3 2
54 6 4 2

Note that the first number is the sequential number the key appears on the Italian 105 PC keyboard, and that the numbering starts from 1, not from 0, so "3" is the fourth key on the physical keyboard.
The second number is the row in the VIC-20 matrix you posted; the third number is the column.
Note also that the shift code for the "£" is 0 (not "1" as I originally thought) because the shift code means "do you want the VIC-20 key shifted or not?". So if I put "1" there I get the PETSCII character you get on a real VIC when you hit the "£" key with SHIFT.
Finally, note that I had to define keys 42 (left shift) and 54 (right shift) for this to work.
With all this in mind, I'll eventually be able to post the IT sym key file for XVIC, and now you know how to do the trick for any language.
Cheers!

Re: Symbolic keyboard map for XVIC - Italian

Posted: Sat Feb 17, 2018 9:32 am
by LoadError
And... there you go! Italian fellows, feel free to beta test it :D
I had to make these non intuitive choices:
- the left arrow is mapped to the "\" - "|" key (leftmost on row 1) where it would be on a VIC, as there is no symbolic equivalent in the IT keyboard
- similarly, the up arrow is mapped to "ì"
- since "]" is on the same key as "+" and "*", I chose to have "[" on "è" and "]" on SHIFT + "è"
Enjoy!

Re: Symbolic keyboard map for XVIC - Italian

Posted: Sat Feb 17, 2018 2:39 pm
by orion70
Great job! Thanks to you, Load, I learned how to make typing in x64 easier with an Italian keyboard, and only a few days after you provide a ready-to-go solution for xvic. Thanks a lot for you obstinacy, and for the patience :wink: Maybe you should submit it to the VICE team?

As a sidenote, I guess I'll have to stick to stickers for some keys, such as the special ones, but all in all typing stuff in will be much more intuitive :P

Re: Symbolic keyboard map for XVIC - Italian

Posted: Mon Feb 19, 2018 3:36 pm
by LoadError
Another thing I realized is that whenever you define a symbol you don't need to also define the SHIFTed symbol if it matches the Commodore keyboard.
I.e. you don't have to define SHIFT+1 in the Italian keyboard, as it's "!" both in the Italian keyboard and on the Commodore keyboard. Hence some of the definitions in my file are redundant (but won't hurt).
Same thing goes for all the PETSCII characters.

Re: Symbolic keyboard map for XVIC - Italian

Posted: Tue Feb 20, 2018 12:14 am
by orion70
The only downside is, people from all over Europe will ask you to personalize their keyboards :D

Re: Symbolic keyboard map for XVIC - Italian

Posted: Tue Feb 20, 2018 12:36 pm
by groepaz
just let me know when this keymap is "ready", then i can drop it into the vice repo :)

Re: Symbolic keyboard map for XVIC - Italian

Posted: Tue Feb 20, 2018 1:16 pm
by LoadError
There are a few issues to figure out before it can be committed to VICE.
1) in some cases I had to define two symbols (one not shifted and one shifted) for keys that, in the Commodore keyboard, have a single symbol and a PETSCII symbol. One such example is the " ' "/" ? " key which is on the right of the " 0 " key in the Italian keyboard. On the Commodore keyboard, the corresponding key is " + " and thus the PETSCII symbol for that key is lost because the shifted key is already assigned to " ? ".
2) in some cases, hitting LEFT CTRL (the Commodore key) + a key results in an unexpected symbol. Example: SHIFT + " 3 " in the Commodore keyboard is " # " but in the Italian keyboard is " £ ". If I press SHIFT + 3 with my layout, I get " £ " but if I hit LEFT CTRL + 3 I get " # " (I expected to get " 3 ").
3) in some cases, I had to assign a symbol that is shifted on the Commodore keyboard, to an unshifted PC key (an example is the " ' " character again). In these cases, if I hit LEFT CTRL + " ' " I get the expected PETSCII character, but I also switch from uppercase to lowercase which is unexpected (the reason is that the " ' " key is shifted on the Commodore keyboard so it's like I was hitting SHIFT + CBM.
These issues would possibly be solved by some VICE expert.

Anyway I've done a few fixes to the IT layout so I reposted it above, as I found a few mistakes. Grab it again if you wish. :)

Re: Symbolic keyboard map for XVIC - Italian

Posted: Fri Feb 23, 2018 5:42 am
by LoadError
I've decided to map three Commodore keys to unused keys, to solve the problem with the inability to access some PETSCII symbols due to the Italian keyboard layout:

F9 doubles as +
F10 doubles as £
F11 doubles as *

This way you can get the symbolic intuitive key layout and still be able to access the PETSCII symbols by using SHIFT and CTRL with F9/F10/F11.

What do you think?