Menu

#1170 some flags are being ignored and/or do not work as expected

v3.6
closed-out-of-date
gpz
None
Keyboard mapping
2022-06-03
2019-12-29
No

With a Swiss keyboard, a correct symbolic key mapping can't be done. To help with debugging I created an artificial keymap that works on any keyboard. It only uses the keys F, G, H, and J.

The issue is that some of the flags are being ignored under some circumstances:

  • Flag "16" (de-shift) is ignored, if the value for the base key (unshifted) must be shifted on the C64. The Swiss keyboard has a key "$", and it's shift value is "£", The "$" on the C64 is Shift-4, and the Pound is unshifted. There is no way to get an unshifted Pound value out of this key. Keys "F" and "G" reproduce this issue.
  • The new Flag "512" (AltGr modifier) apparently can't be combined with flag "32" (another definition). Key "J" reproduces this problem. Luckily there is a workaround here, see key "H". However, the official symbolic german keymap uses the not-working method, and therefore none of the AltGr keys work.
1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Martin Erzberger

    Can't find an "edit" button for my original report. It's supposed to be two bullet points, not italic text. Sorry about this.

     
  • gpz

    gpz - 2020-10-06

    could you please describe in that configfile

    • what exactly is printed on the keys, shifted and unshifted
    • what scancodes does the statusbar show

    i have to try to reproduce this using a german keyboard. i am sure we can solve it, at least i managed it with all strange things on the german layout

     
  • Martin Erzberger

    I'm not quite sure what's missing, could you elaborate? The file is only for test purposes, to reproduce the issues that I see. Otherwise, it has no practical usage at all.

    In the file it says e.g. 'Physical Key "F"'. So that's what is printed on the key: "F". If you load this keymap (on your German keyboard), and then press the key "F" on the keyboard, it should show a dollar on the screen. Shifted, it should show the pound. But it doesn't. Scancodes are the usual ones for the keys printed, e.g. 102 for "F".

    I need this to work because on the regular Swiss keyboard layout, there is a key $/£ (unshifted and shifted). So for a symbolic Swiss keymap, I must be able to generate a pound sign while holding down the shift key, but I can't. Because no such key exists on any other keyboard, I use the "F" key instead in the keymap to demonstrate the issue.

    Hope this helps, if not please let me know. Thanks!

     

    Last edit: Martin Erzberger 2020-10-10
  • Greg King

    Greg King - 2020-10-10

    There seems to be some bleed-over between the two mappings. If I remove the 1 (key is combined with shift) flag from the unshifted mapping, then the shifted mapping works -- even without the 16 (deshift key) flag!

     
  • Martin Erzberger

    True, I also have seen this. I thought that the "de-shift" has been added for this exact purpose:

    • On the commodore, the key ($) is shifted, but on the physical keyboard it isn't. So, Flag "1" is required to make this happen.
    • But now, the shifted value of the physical keyboard needs to be mapped to an unshifted key on the commodore (£). -> Hence the "de-shift"-flag. This seems to be the flag's sole purpose.

    The flag just does not seem to work.

    That de-shift is not required if flag 1 is not set would not be surprising, if my interpretation of the de-shift flag's purpose is correct.

     

    Last edit: Martin Erzberger 2020-10-11
  • gpz

    gpz - 2020-10-13

    I see the problem now... strange i never ran into it when fixing the german keymaps :) Yes, the deshift key is exactly for what you thought it is for.

    The problem with alt-gr+@ can be "solved" just be switching the two lines around

    The other case... good question

    i am a bit reluctant to make changes to the related code right now, as we are slowly preparing for the christmas release, and changes to the keymap code requires an insane amount of testing (most of which we cant even do ourselves)

    It would help a whole lot if someone could create keymaps for testing, containing all kinds of useful combination of those flags, similar to the one already posted (using physical keys a-z only), and for both SDL and GTK ports :) That'd hopefully make it easier/quicker to spot what's wrong and fix it once and for all.

     
  • gpz

    gpz - 2021-09-12

    please test again with a recent built, i have recently comitted a fix for the virtual shift and deshift, which should solve some of the odd cases

     
  • gpz

    gpz - 2021-10-25

    again i repeat the request - i have fixed the US and DE mappings and found zero cases that i couldnt solve correctly - we should be able to sort out the swiss one too!

     
  • Martin Erzberger

    At the time I tried to get an SDL2 mapping for the Mac implemented. Meanwhile the GTK3 build is recommended also for MacOS. I did not look at GTK3 key mapping at all, so my question: Is your fix also relevant for GTK3, or is this only an SDL thing?

     
  • gpz

    gpz - 2021-10-25

    i fixed both GTK3 and SDL keymaps, and in case of the US mappings both symbolic and positional, and for all emulators

     
  • Martin Erzberger

    Great, thanks. So far I downloaded a version via homebrew. I think it's the latest available build, but I can't really tell. It simply reports v3.5 in "About" or when starting up. Is there a way to get the "real" version, e.g. the Git hash of the build or something similar?
    EDIT: Sorry, vice is SVN, so no Git hash...

     

    Last edit: Martin Erzberger 2021-10-25
  • gpz

    gpz - 2021-10-25

    Yes, you can get the svn head revision using homebrew... but i cant tell how, i am not a mac user shrug

     
  • Martin Erzberger

    I believe I managed to download the HEAD revision, but I am not sure. For example, the .vkm files all have a date of December 23, 2020. I am wondering how I can determine the version of e.g. x64sc that I have started. "About" simply reports 3.5. Ideally I could somehow see the revision, such as r40965 which seems to be the current trunk head.

     
  • gpz

    gpz - 2021-10-25

    it should say "3.5 r40965" in the About dialog, if it only says "3.5" than this is the december release

     
  • Martin Erzberger

    Strange.. I did have the december release before, but now I managed to build from source, and I did check out the trunk, revision 40965. The keymap files are from October 19 2021 this time. Still: About... reports 3.5

     
  • gpz

    gpz - 2021-10-25

    mmmh i dont know how the homebrew builds work exactly... configure needs to see the "svnversion" program, if it doesnt find this, it will not add the revision (because it cant). (The same also happens if you build from a release tarball, for example)

    Anyway, if you got the updated files, then it should probably work :=)

     
  • Martin Erzberger

    It does work ;-) I only tried the formerly problematic key on the Swiss German keyboard: $/£. This works:
    dollar 1 3 1
    sterling 6 0 16

    It was trial-and-error, because I do not quite understand the meaning of the flags related to shift.

    I haven't looked at all of the Alt-Gr (on the Mac: Option Key) stuff yet, and hope to do this on the weekend.

    Thanks for the fix and best regards, Martin

     

    Last edit: Martin Erzberger 2021-10-25
    • dqh

      dqh - 2021-10-25

      I believe the mac Option key is Alt, not Alt-Gr.

       
  • gpz

    gpz - 2021-10-25

    sounds good! i am keeping this open as a reminder, waiting for your keymap :)

     
  • Querino

    Querino - 2021-10-25

    i have a swiss keyboard too, maybe i could help. i haven't played yet with gtk3 keymaps though,and have only windows.

     
  • Martin Erzberger

    One question: In the Menu (Input Devices, Keyboard) there is an entry "Host Keyboard Layout". It only has a few possible selections, and "Swiss" is not amongst them. What exactly does this entry do? It does not seem to have any effect on the keyboard layout.

    As for Mac/PC:
    Ideally both a PC and a Mac version for a keymap could be developed. Possibly only one is necessary, because it seems as if GTK3 removes at least some of the differences between Mac and PC (for example the two keys "</>" and "§/°" are swapped, but GTK3 along with the operating system removes this difference).

    I don't know yet about characters such as the open caret: On the Mac this is Option-5, and on the PC it's AltGr-ü. Maybe Gtk3 also resolves this, but I haven't tried yet.

    Lastly a warning: I will work from time to time on this, but it will take a while. Please don't hold you breath on this ticket ;-)

     
  • gpz

    gpz - 2021-10-30

    One question: In the Menu (Input Devices, Keyboard) there is an entry "Host Keyboard Layout". It only has a few possible selections, and "Swiss" is not amongst them. What exactly does this entry do? It does not seem to have any effect on the keyboard layout.

    It is used to determine which keyboard layout should be loaded - once we actually have a mapping for a swiss keyboard, i will add the respective option there :)

    Ideally both a PC and a Mac version for a keymap could be developed.

    I dont agree - ideally the differences are actually abstracted away correctly by GTK :) Having a keymap per OS triples the amount of work needed, and as a result we will have even less correctly working keymaps

     
  • gpz

    gpz - 2021-10-30

    One question: In the Menu (Input Devices, Keyboard) there is an entry "Host Keyboard Layout". It only has a few possible selections, and "Swiss" is not amongst them. What exactly does this entry do? It does not seem to have any effect on the keyboard layout.

    It is used to determine which keyboard layout should be loaded - once we actually have a mapping for a swiss keyboard, i will add the respective option there :)

    Ideally both a PC and a Mac version for a keymap could be developed.

    I dont agree - ideally the differences are actually abstracted away correctly by GTK :) Having a keymap per OS triples the amount of work needed, and as a result we will have even less correctly working keymaps

     
  • Martin Erzberger

    Thanks! GTK abstracts most of it, but not all. I can give you an example, but be warned: It's a bit convoluted...

    The C64 has a dedicated key "@". On the Mac, this is mapped to Option-G, and on the PC to AltGr-2. This works fine with GTK, because of the symbolic name "at". Only problem so far is the comment in the keymap file: One can't use "AltGr" or "Option", and one can't mention "2" or "g", to prevent platform specific wording.

    So far so good. Now about Shift-@ on the C64. I believe the most intuitive way to symbolically map this is to press Shift + [Option-G | AltGr-2], i.e. Shift plus the combo that generates the at sign.

    On the Mac, this works:

    # @-key
    at             5 6 0
    # extra: Shift-Option-G -> @+shift
    singlelowquotemark  5 6 1
    

    This will not work on the PC, obviously (I don't really know where the singlelowquotemark is, but I guess not on the "2" key).
    Maybe this would work, but I don't know:

    at 5 6 32
    at 5 6 129
    

    Maybe there will be more such examples, I don't know yet.

    One question: The comment in the german keymap file says that the Commodore-Key is mapped to Ctrl (which would be a positional mapping). The actual keymap is then to "Tab", not Control. Is the comment wrong, or the mapping?

     

    Last edit: Martin Erzberger 2021-10-30
  • gpz

    gpz - 2021-10-30

    This will not work on the PC, obviously (I don't really know where the singlelowquotemark is, but I guess not on the G key).

    In such cases, please put into comments that is MacOS specific - hopefully we can just add another mapping for PC and have both working in the same keymap (i think some of the swedish keymaps have similar hacks in them)

    One question: The comment in the german keymap file says that the Commodore-Key is mapped to Ctrl (which would be a positional mapping). The actual keymap is then to "Tab", not Control. Is the comment wrong, or the mapping?

    The comment :) In symbolic mapping, control maps to control and (if the emulated keyboard has no TAB) commdore maps to TAB

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB