ColinPitrat / caprice32

An emulator of the Amstrad CPC 8bit home computer range.
GNU General Public License v2.0
148 stars 32 forks source link

[CONTRIBUTION] Finnish keyboard linux for UK CPC Language #168

Open kamelie1706 opened 4 years ago

kamelie1706 commented 4 years ago

Hi,

Here is my finnish keyboard mapping for UK CPC tested on Linux.

CPC_0   SDLK_0
CPC_1   SDLK_1
CPC_2   SDLK_2
CPC_3   SDLK_3
CPC_4   SDLK_4
CPC_5   SDLK_5
CPC_6   SDLK_6
CPC_7   SDLK_7
CPC_8   SDLK_8
CPC_9   SDLK_9
CPC_A   SDLK_a  MOD_PC_SHIFT
CPC_B   SDLK_b  MOD_PC_SHIFT
CPC_C   SDLK_c  MOD_PC_SHIFT
CPC_D   SDLK_d  MOD_PC_SHIFT
CPC_E   SDLK_e  MOD_PC_SHIFT
CPC_F   SDLK_f  MOD_PC_SHIFT
CPC_G   SDLK_g  MOD_PC_SHIFT
CPC_H   SDLK_h  MOD_PC_SHIFT
CPC_I   SDLK_i  MOD_PC_SHIFT
CPC_J   SDLK_j  MOD_PC_SHIFT
CPC_K   SDLK_k  MOD_PC_SHIFT
CPC_L   SDLK_l  MOD_PC_SHIFT
CPC_M   SDLK_m  MOD_PC_SHIFT
CPC_N   SDLK_n  MOD_PC_SHIFT
CPC_O   SDLK_o  MOD_PC_SHIFT
CPC_P   SDLK_p  MOD_PC_SHIFT
CPC_Q   SDLK_q  MOD_PC_SHIFT
CPC_R   SDLK_r  MOD_PC_SHIFT
CPC_S   SDLK_s  MOD_PC_SHIFT
CPC_T   SDLK_t  MOD_PC_SHIFT
CPC_U   SDLK_u  MOD_PC_SHIFT
CPC_V   SDLK_v  MOD_PC_SHIFT
CPC_W   SDLK_w  MOD_PC_SHIFT
CPC_X   SDLK_x  MOD_PC_SHIFT
CPC_Y   SDLK_y  MOD_PC_SHIFT
CPC_Z   SDLK_z  MOD_PC_SHIFT
CPC_a   SDLK_a
CPC_b   SDLK_b
CPC_c   SDLK_c
CPC_d   SDLK_d
CPC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_PC_CTRL
CPC_CTRL_z  SDLK_z  MOD_PC_CTRL
CPC_CTRL_0  SDLK_0  MOD_PC_CTRL
CPC_CTRL_1  SDLK_1  MOD_PC_CTRL
CPC_CTRL_2  SDLK_2  MOD_PC_CTRL
CPC_CTRL_3  SDLK_3  MOD_PC_CTRL
CPC_CTRL_4  SDLK_4  MOD_PC_CTRL
CPC_CTRL_5  SDLK_5  MOD_PC_CTRL
CPC_CTRL_6  SDLK_6  MOD_PC_CTRL
CPC_CTRL_7  SDLK_7  MOD_PC_CTRL
CPC_CTRL_8  SDLK_8  MOD_PC_CTRL
CPC_CTRL_9  SDLK_9  MOD_PC_CTRL
CPC_AMPERSAND   SDLK_6  MOD_PC_SHIFT
CPC_ASTERISK    SDLK_QUOTE  MOD_PC_SHIFT
CPC_AT  SDLK_2  MOD_PC_MODE
CPC_BACKQUOTE   SDLK_BACKSLASH  MOD_PC_SHIFT
CPC_BACKSLASH   SDLK_PLUS   MOD_PC_MODE
CPC_CAPSLOCK    SDLK_CAPSLOCK
CPC_CLR SDLK_BACKSPACE
CPC_COLON   SDLK_PERIOD MOD_PC_SHIFT
CPC_COMMA   SDLK_COMMA
CPC_CONTROL SDLK_LCTRL
CPC_COPY    SDLK_LALT
CPC_CPY_DOWN    SDLK_DOWN   MOD_PC_SHIFT
CPC_CPY_LEFT    SDLK_LEFT   MOD_PC_SHIFT
CPC_CPY_RIGHT   SDLK_RIGHT  MOD_PC_SHIFT
CPC_CPY_UP  SDLK_UP MOD_PC_SHIFT
CPC_CUR_DOWN    SDLK_DOWN
CPC_CUR_LEFT    SDLK_LEFT
CPC_CUR_RIGHT   SDLK_RIGHT
CPC_CUR_UP  SDLK_UP
CPC_CUR_HOMELN  SDLK_HOME
CPC_CUR_ENDLN   SDLK_END
CPC_CUR_HOMEBL  SDLK_HOME   MOD_PC_CTRL
CPC_CUR_ENDBL   SDLK_END    MOD_PC_CTRL
CPC_DBLQUOTE    SDLK_2  MOD_PC_SHIFT
CPC_DEL SDLK_BACKSPACE
CPC_DOLLAR  SDLK_4  MOD_PC_MODE
CPC_ENTER   SDLK_KP_ENTER
CPC_EQUAL   SDLK_0  MOD_PC_SHIFT
CPC_ESC SDLK_ESCAPE
CPC_EXCLAMATN   SDLK_1  MOD_PC_SHIFT
CPC_F0  SDLK_KP0
CPC_F1  SDLK_KP1
CPC_F2  SDLK_KP2
CPC_F3  SDLK_KP3
CPC_F4  SDLK_KP4
CPC_F5  SDLK_KP5
CPC_F6  SDLK_KP6
CPC_F7  SDLK_KP7
CPC_F8  SDLK_KP8
CPC_F9  SDLK_KP9
CPC_FPERIOD SDLK_KP_PERIOD
CPC_GREATER SDLK_LESS   MOD_PC_SHIFT
CPC_HASH    SDLK_3  MOD_PC_SHIFT
CPC_LBRACKET    SDLK_8  MOD_PC_MODE
CPC_LCBRACE SDLK_7  MOD_PC_MODE
CPC_LEFTPAREN   SDLK_8  MOD_PC_SHIFT
CPC_LESS    SDLK_LESS
CPC_LSHIFT  SDLK_LSHIFT
CPC_MINUS   SDLK_MINUS
CPC_PERCENT SDLK_5  MOD_PC_SHIFT
CPC_PERIOD  SDLK_PERIOD
CPC_PIPE    SDLK_LESS   MOD_PC_MODE
CPC_PLUS    SDLK_PLUS
CPC_POUND   SDLK_3  MOD_PC_MODE
CPC_POWER   SDLK_UP MOD_PC_MODE
CPC_QUESTION    SDLK_PLUS   MOD_PC_SHIFT
CPC_QUOTE   SDLK_QUOTE
CPC_RBRACKET    SDLK_9  MOD_PC_MODE
CPC_RCBRACE SDLK_0  MOD_PC_MODE
CPC_RETURN  SDLK_RETURN
CPC_RIGHTPAREN  SDLK_9  MOD_PC_SHIFT
CPC_RSHIFT  SDLK_RSHIFT
CPC_SEMICOLON   SDLK_COMMA  MOD_PC_SHIFT
CPC_SLASH   SDLK_7  MOD_PC_SHIFT
CPC_SPACE   SDLK_SPACE
CPC_TAB SDLK_TAB
CPC_UNDERSCORE  SDLK_MINUS  MOD_PC_SHIFT
#
# Emulator keymap
#
CAP32_DEBUG SDLK_F12
CAP32_EXIT  SDLK_F10
CAP32_SPEED SDLK_F9
CAP32_FPS   SDLK_F8
CAP32_JOY   SDLK_F7
CAP32_MF2STOP   SDLK_F6
CAP32_RESET SDLK_F5
CAP32_TAPEPLAY  SDLK_F4
CAP32_SCRNSHOT  SDLK_F3
CAP32_SNAPSHOT  SDLK_F3 MOD_PC_SHIFT
CAP32_FULLSCRN  SDLK_F2
CAP32_GUI   SDLK_F1
CAP32_VKBD  SDLK_F1 MOD_PC_SHIFT
CAP32_WAITBREAK SDLK_BREAK
CAP32_DELAY SDLK_BREAK  MOD_PC_SHIFT
kamelie1706 commented 4 years ago

I would like to make a mapping for the french cpc. Is it possible to map a sequence of keys for one character?

By the way this mapping should work for all nordic keyboards (Swedish/Danish/Norwegian/Finnish/Island?) + Estonia + ... maybe more

ColinPitrat commented 4 years ago

Sorry for not answering earlier. Can you submit a PR with the change? If you don't know how to do it, I can do the change if you are able to test it.

For the French keyboard, it's not possible to map a sequence of keys. Why do you need it? For accents? The mapping represents the mapping of the host keyboard. There's no need for a different mapping per language. Currently the idea is really to have the host keyboard corresponding to the CPC keyboard (e.g both french, both english ...). It's likely that there would be issues trying to mix them. But you can try making a mapping file that provides both UK and FR CPC keys (by adding CPCFR* keys in your mapping)