jangler / faunatone

Tracker-style microtonal MIDI sequencer
Mozilla Public License 2.0
34 stars 1 forks source link

"§" key doesn't seem to work as a shortcut #4

Closed Savestate2A03 closed 2 years ago

Savestate2A03 commented 2 years ago

Attempting to use the section sign "§" (U+00A7) as a shortcut key doesn't seem to work.

Images attached

Windows 10-20H2 faunatone v0.1.0

image

image

image

Savestate2A03 commented 2 years ago

To clarify: in addition to not displaying properly, the shortcut itself doesn't work. The font does seem to support the character when used in a text editor.

image

jangler commented 2 years ago

The SDL documentation says:

"`" (Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.)

…which makes it sound to me like your § key should activate a shortcut mapped to `. If not then I'm not sure how to solve this.

The character does display correctly for me on Linux which makes me think that part is a UTF8 vs UTF16 problem.

Savestate2A03 commented 2 years ago

I'll give it a test in the morning 👍

langel commented 2 years ago

is that the kind of freak keyboards they sell in sweden?!?! wowowowow

Savestate2A03 commented 2 years ago

lmao yeah puke, i spilled an energy drink on my old keyboard and picked this up at the store completely forgetting they had different keyboards here. figured i might as well get used to it though since i'm living here for the foreseeable future

also has åäö and other goodies like native grave key usage to get £ and €


Tried setting grave mark in settings and using section key, doesn't seem to work. Here's a test after using the SDL2 wrapper for Python to get the scancode, keycode, and keyname if it exists. The 3rd is the Section key on a nordic keyboard.

PS C:\Users\eelkjos\Documents\sdltest> python .\sdltest.py
UserWarning: Using SDL2 binaries from pysdl2-dll 2.0.16
            SDL_Scancode: 11
             SDL_Keycode: 104
SDL_GetKeyFromScancode(): 104
        SDL_GetKeyName(): b'H'
-------------------------
            SDL_Scancode: 57
             SDL_Keycode: 1073741881
SDL_GetKeyFromScancode(): 1073741881
        SDL_GetKeyName(): b'CapsLock'
-------------------------
            SDL_Scancode: 53
             SDL_Keycode: 167
SDL_GetKeyFromScancode(): 167
        SDL_GetKeyName(): b'\xc2\xa7'

Doesn't seem that there is a key name for this scancode.

Savestate2A03 commented 2 years ago

Ok, so turns out utf-8 c2a7 is the section symbol, and testing on my work laptop, this actually works just fine. Something is up on my home desktop then, def something with encoding. I'll have to see what's up.

langel commented 2 years ago

wow when did capslock get a 32bit keycode? 😭

Savestate2A03 commented 2 years ago

Apparently they're all 32 bit!

Keycodes without character representations are determined by their scancode bitwise OR-ed with 1<<30 (0x40000000).

via https://wiki.libsdl.org/SDLKeycodeLookup

langel commented 2 years ago

oh wow! i'm learning sdl right now and i haven't done much with the keyboard yet :o

jangler commented 2 years ago

@Savestate2A03 when you get a chance, can you attach the settings.csv that's causing the problem? I should be able to fix it from there.

jangler commented 2 years ago

Well, I guess I won't be able to fix the input problem itself. But I can try to handle the character encoding part.

Savestate2A03 commented 2 years ago

Oops, forgot and went to bed without getting on my desktop lol. Just checked, can confirm it was an encoding issue. Excel was encoding with ANSI, opened it with notepad and changed it to UTF-8 and it works fine. Thanks Excel!

image

Savestate2A03 commented 2 years ago

image

jangler commented 2 years ago

ANSI?? nvm not supporting that lmao

langel commented 2 years ago

oof character encoding is nightmare fuel