Btw, if someone donate me a Mac, I promise I will present a better keymap ;-P ;-P
This has to be enough!
Du bist in Begriff, Forum64 zu verlassen, um auf die folgende Adresse weitergeleitet zu werden:
Bitte beachte, dass wir für den Inhalt der Zielseite nicht verantwortlich sind und unsere Datenschutzbestimmungen dort keine Anwendung finden.
letzter Beitrag von LGB-Z am
Btw, if someone donate me a Mac, I promise I will present a better keymap ;-P ;-P
This has to be enough!
Bitter schön
Btw, if someone donate me a Mac, I promise I will present a better keymap ;-P ;-P
This has to be enough!
Ok, how I can press the keys and receive the SDL2 scan symbols? ;-P OK. Seriously. Hopefully I'll have time to finish the keyboard remapper GUI part, so then everybody can do his own beloved layout on any platform
Hopefully I'll have time to finish the keyboard remapper GUI part, so then everybody can do his own beloved layout on any platform
That would be great!
By the way: a very big compliment for your Xemu! It's a great emu and I use it very often. Great work!
Hopefully I'll have time to finish the keyboard remapper GUI part, so then everybody can do his own beloved layout on any platform
That would be great!
By the way: a very big compliment for your Xemu! It's a great emu and I use it very often. Great work!
... great work will be. Hopefully. But I'm trying it to become that
Ok, I had an initial sniff of SDL and keys on a mac keyboard. Don't have any full answer yet, just some hints.
This project has some header file which has this darwin_scancode_table[] array which maps beween mac keyboard and sdl keycodes:
https://github.com/native-tool…events/scancodes_darwin.h
In there, I see two entries for SDL_SCANCODE_KP_ENTER:
/* 52 */ SDL_SCANCODE_KP_ENTER, /* keyboard enter on portables */
/* 76 */ SDL_SCANCODE_KP_ENTER, /* keypad enter on external keyboards, fn-return on portables */
Hmm, it seems odd that they'd map two unique scancodes to the same sdl-scancode. At a guess, it seems to be the scancode behaviour of a mac with a proper external keyboard versus a macbook with its more minimal keyset (and the need for more fn-key-combo tricks to make up for missing keys).
As for what xemu should do about this, at this stage, not sure, I'm still mulling it over and coming to terms with it all
Oh, and oddly, if I simply press the enter key on my macbook, I see inside xemu's hid_key_event(), it sees this sdl scancode:
/* 36 */ SDL_SCANCODE_RETURN,
This surprises me, as the comments in the code earlier seem to suggest that a 'portable' (macbook) should report the enter key as darwin scancode 52 (and not 36).
This is kinda complicated topic, it can even vary between OS versions (on the same OS) and different keyboards. Surely, the very basic keys should be the same, but actually what SDL 'sees' are more like the product of OS itself, and not the physical keys, as of course an app cannot easily access the hardware directly, only via the OS. I'm not even sure what happens, if someone has different keyboard layout set in its OS, will the scan codes change as well? Or only the higher level key (not scan) codes, as SDL has both of them (though for some reason would be hard to explain now, I stick with scan codes currently).
I appreciate your emulator very much! I use it together with a MEGA prototype for testing and application programming.
Working on a MAC, I had to edit a keymap.cfg file, because the default file is suitable for a PC keyboard, but less practicable for a MAC keyboard.
But I had problems, to find PC keynames for some keys.
I wanted, for example, to map the circumflex ^ key to the back-arrow key of the MEGA65 (same position on the keyboard) and tried:
LARROW ^
but this resulted in an error emu_name=[LARROW] host_key=<^>: Unknown host keyname
LARROW Circumflex
didn't work either.
Where can I find the correct host keynames?
Alles anzeigenI appreciate your emulator very much! I use it together with a MEGA prototype for testing and application programming.
Working on a MAC, I had to edit a keymap.cfg file, because the default file is suitable for a PC keyboard, but less practicable for a MAC keyboard.
But I had problems, to find PC keynames for some keys.
I wanted, for example, to map the circumflex ^ key to the back-arrow key of the MEGA65 (same position on the keyboard) and tried:
LARROW ^
but this resulted in an error emu_name=[LARROW] host_key=<^>: Unknown host keyname
LARROW Circumflex
didn't work either.
Where can I find the correct host keynames?
All key names (for "host") actually SDL2 scancodes, so they are not Xemu specific but SDL2. It's important to note, that it's scancode based system. ie you cannot do a mapping where a "hostkey" is shifted, but the emulated key is not shifted or vice versa, maybe with different modifier keys, since it's a single "key is pressed, so" kind of theory, which simply cannot handle the situation of the modifier key even not in theory (ie, just imagine what would happen if you press SHIFT+something, Xemu would pass the SHIFT as well for the emulated machine, so you see the assigned key is also shifted then, as the host key is). But it's kinda natural since the base idea behind this, that it's simply a key-to-key mapping, including shift-ctrl-commodore .... etc.
But to finally answer to your question Indeed, it's a bit hard to get to know what the actual SDL2 scancode names are ... Probably you need to check in SDL2 source code itself, like here:
https://hg.libsdl.org/SDL/file…src/events/SDL_keyboard.c
Starting at line saying: "static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = {"
A relative trivial thing I can do (within some minutes of work today, for example, tell me, if you're interested, since otherwise not so useful generic thing for most of the users ...), to give an option in Xemu to turn on OSD-display for the HID-keyboard layer so you'll see the pressed "scancode names" you can use.
Surely, the REAL solution is still the included keymap editor functionality of Xemu, which I had still no time to finish but I've already started once [upon a time ...]
Alles anzeigenAll key names (for "host") actually SDL2 scancodes, so they are not Xemu specific but SDL2. It's important to note, that it's scancode based system. ie you cannot do a mapping where a "hostkey" is shifted, but the emulated key is not shifted or vice versa, maybe with different modifier keys, since it's a single "key is pressed, so" kind of theory, which simply cannot handle the situation of the modifier key even not in theory (ie, just imagine what would happen if you press SHIFT+something, Xemu would pass the SHIFT as well for the emulated machine, so you see the assigned key is also shifted then, as the host key is). But it's kinda natural since the base idea behind this, that it's simply a key-to-key mapping, including shift-ctrl-commodore .... etc.
But to finally answer to your question Indeed, it's a bit hard to get to know what the actual SDL2 scancode names are ... Probably you need to check in SDL2 source code itself, like here:
https://hg.libsdl.org/SDL/file…src/events/SDL_keyboard.c
Starting at line saying: "static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = {"
A relative trivial thing I can do (within some minutes of work today, for example, tell me, if you're interested, since otherwise not so useful generic thing for most of the users ...), to give an option in Xemu to turn on OSD-display for the HID-keyboard layer so you'll see the pressed "scancode names" you can use.
Surely, the REAL solution is still the included keymap editor functionality of Xemu, which I had still no time to finish but I've already started once [upon a time ...]
One option with a OSD Display which shows the scancodes would be very apreciated.
Of course with the ability to turn on or off.
OK, done, well, ... kind of In the "dev" branch only though. UI menu "Display" has a new option to toggle this feature on/off, it's off by default. As usual, all the master and devel branch builds are automatically built so can be downloaded (without manual compilation) at the usual place (though, do not forget to use 'devel' since it's the dev(el) branch ...): https://github.lgb.hu/xemu/
Thank you very much! The OSD display will help a lot.
I think, I've found the problem of the circumflex key.
It is the unshifted key left of the '1' key on GERMAN keyboards.
ASCII keyboards have the backtick/tilde key there and that is probably the name I should use in the keymap file.
I tried:
LARROW `
It doesn't give an error message, but has no effect. The key is dead and cannot be used in the emulator.
It is also not possible to map other any key to the backtick key.
Btw if you can find out some better Mac default, I can include that as the default. I have no Mac, so I cannot tell what is problematic or not there ...... The sight problem that included Xemu kbd mapping (for being a little more fun, hehe) is _not_ based on names like config files, but constants which are not the very same. Well yeah, SDL2 can be a kind of tricky sometimes ...
Thank you very much! The OSD display will help a lot.
I think, I've found the problem of the circumflex key.
It is the unshifted key left of the '1' key on GERMAN keyboards.
ASCII keyboards have the backtick/tilde key there and that is probably the name I should use in the keymap file.
Keep in mind that Commodore has 2 keys that always differs from ASCII/DIN -> english pound sign and ^ not meant as accent here but as to the power of.. like in 2^3 (two to the power of 3)
Thank you very much! The OSD display will help a lot.
I think, I've found the problem of the circumflex key.
It is the unshifted key left of the '1' key on GERMAN keyboards.
ASCII keyboards have the backtick/tilde key there and that is probably the name I should use in the keymap file.
Keep in mind that Commodore has 2 keys that always differs from ASCII/DIN -> english pound sign and ^ not meant as accent here but as to the power of.. like in 2^3 (two to the power of 3)
I was workin on a positional mapping, not a symbolic mapping.
So I don't care about the circumflex ^ itself.
I just wanted to map the left most key in the numeric row to the Commodore/MEGA65 key in the left most position of the numeric row.
On the MEGA65 the key is labelled as back arrow.
ASCII PC keyboards have a backtick/Tilde label there.
German keyboards have a circumflex/degree symbol there.
So I wanted just, that that this key on the PC or MAC keyboard produces a backarrow.
But it cannot be mapped alltogether in the keymap.cfg file. It remains dead.
Btw if you can find out some better Mac default, I can include that as the default. I have no Mac, so I cannot tell what is problematic or not there ...... The sight problem that included Xemu kbd mapping (for being a little more fun, hehe) is _not_ based on names like config files, but constants which are not the very same. Well yeah, SDL2 can be a kind of tricky sometimes ...
Yes, it's tricky But I do my best and send you the MAC optimised keymap.cfg, when it's finished.
Btw if you can find out some better Mac default, I can include that as the default. I have no Mac, so I cannot tell what is problematic or not there ...... The sight problem that included Xemu kbd mapping (for being a little more fun, hehe) is _not_ based on names like config files, but constants which are not the very same. Well yeah, SDL2 can be a kind of tricky sometimes ...
Yes, it's tricky But I do my best and send you the MAC optimised keymap.cfg, when it's finished.
Yeah, and then I need to figure out the constant values for those names, what I meant :-O anyway, it should be OK to be extracted from the SDL2 source that way, in principle. I always thought this is a bit overcomplicated in SDL2 how it's handled. Anyway ...
Guys,
I just installed XEMU (Windows) to experiment while waiting for my physical MEGA65. Two questions that came up in regard of the keyboard mapping: Is there a German keyboard mapping available? I can of course switch Y and Z in the config-file easily, but other important stuff not so much, because it is alreaddy mapped to the correct key, it's just that this key is somewhere else on the keyboard with the englisch mapping, if that makes sense.
Also, is there a way to disable the reset-function that's on F10? I just cannot get rid of it. For some weird reason, F10 is mapped to Shift+F9 and the physical F10 key has the reset-funktion although I don't see that reflected in the config file.
Many thanks in advance - and Happy New Year!
Off-topic: Huh, I would be able to kill who invented the Z/Y swap, it's done on Hungarian (my native language) keyboard as well, no idea why (if the reason is to have a better layout suited to the language, then almost all keys should be re-ordered, but no, only these two ones are swapped ... totally insane).
On-topic: personally I never wrote custom keymap files for Xemu, especially, since it should be done by someone who is familiar with the given layout/keyboard.
Beware though, that keymap is positional and not symbolic. So you cannot separate function of a key when shifted, since shift is also pass through the emulation.
Well, to be honest, F9 and F10 is my fault, it's hard coded in the source, since I almost always use those all the time while developing Xemu. Yes, it's very unfortunate, since it can be made customized with some code-reorganization and then I can have a custom keymap just for this functionality to my liking so the benefit that I won't bother other users with my insane hotkey ideas ... I'll do it some day, just there is always something "more important" to work on, sorry about that.