Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/Dialog/PSPOskConstants.cpp
3186 views
1
// Copyright (c) 2012- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#include <cstdint>
19
20
#include "Core/Dialog/PSPOskConstants.h"
21
22
// WARNING: The encoding of this file is WEIRD and gets destroyed if you save it in MSVC!
23
24
// Japanese (Kana) diacritics
25
static const wchar_t diacritics[2][103] = {
26
{L"かがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどはばぱばひびぴびふぶぷぶへべぺべほぼぽぼウヴカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドハバパバヒビピビフブプブヘベペベホボポボ"},
27
{L"はぱばぱひぴびぴふぷぶぷへぺべぺほぽぼぽハパバパヒピビピフプブプヘペベペホポボポ"}
28
};
29
30
// Korean (Hangul) consonant
31
static const wchar_t kor_cons[20] = L"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ";
32
33
// Korean (Hangul) vowels, Some vowels are not used, they will be spaces
34
static const wchar_t kor_vowel[22] = L"ㅏㅐㅑㅒㅓㅔㅕㅖㅗ ㅛㅜ ㅠㅡ ㅣ";
35
36
// Korean (Hangul) vowel Combination key
37
static const uint8_t kor_vowelCom[21] = {0,8,9,1,8,10,20,8,11,4,13,14,5,13,15,20,13,16,20,18,19};
38
39
// Korean (Hangul) last consonant(diacritics)
40
static const wchar_t kor_lcons[28] = L"ㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ";
41
42
// Korean (Hangul) last consonant Combination key
43
static const uint8_t kor_lconsCom[33] = {18,0,2,21,3,4,26,3,5,0,7,8,15,7,9,16,7,10,18,7,11,24,7,12,25,7,13,26,7,14,18,16,17};
44
45
// Korean (Hangul) last consonant Separation key
46
static const uint8_t kor_lconsSpr[33] = {2,1,9,4,4,12,5,4,18,8,8,0,9,8,6,10,8,7,11,8,9,12,8,16,13,8,17,14,8,18,17,17,9};
47
48
static const char16_t oskKeys[OSK_KEYBOARD_COUNT][6][14] = {
49
{
50
// Latin Lowercase
51
{u"1234567890-+"},
52
{u"qwertyuiop[]"},
53
{u"asdfghjkl;@~"},
54
{u"zxcvbnm,./?\\"},
55
},
56
{
57
// Latin Uppercase
58
{u"!@#$%^&*()_+"},
59
{u"QWERTYUIOP{}"},
60
{u"ASDFGHJKL:\"`"},
61
{u"ZXCVBNM<>/?|"},
62
},
63
{
64
// Hiragana
65
{u"あかさたなはまやらわぁゃっ"},
66
{u"いきしちにひみ り ぃ  "},
67
{u"うくすつぬふむゆるをぅゅ゛"},
68
{u"えけせてねへめ れ ぇ ゜"},
69
{u"おこそとのほもよろんぉょー"},
70
{u"・。、「」『』〜 "},
71
},
72
{
73
// Katakana
74
{u"アカサタナハマヤラワァャッ"},
75
{u"イキシチニヒミ リ ィ  "},
76
{u"ウクスツヌフムユルヲゥュ゛"},
77
{u"エケセテネヘメ レ ェ ゜"},
78
{u"オコソトノホモヨロンォョー"},
79
{u"・。、「」『』〜 "},
80
},
81
{
82
// Korean(Hangul)
83
{u"1234567890-+"},
84
{u"ㅃㅉㄸㄲㅆ!@#$%^&"},
85
{u"ㅂㅈㄷㄱㅅㅛㅕㅑㅐㅔ[]"},
86
{u"ㅁㄴㅇㄹㅎㅗㅓㅏㅣ;@~"},
87
{u"ㅋㅌㅊㅍㅠㅜㅡ<>/?|"},
88
},
89
{
90
// Russian Lowercase
91
{u"1234567890-+"},
92
{u"йцукенгшщзхъ"},
93
{u"фывапролджэё"},
94
{u"ячсмитьбю/?|"},
95
},
96
{
97
// Russian Uppercase
98
{u"!@#$%^&*()_+"},
99
{u"ЙЦУКЕНГШЩЗХЪ"},
100
{u"ФЫВАПРОЛДЖЭЁ"},
101
{u"ЯЧСМИТЬБЮ/?|"},
102
},
103
{
104
// Latin Full-width Lowercase
105
{ u"1234567890-+" },
106
{ u"qwertyuiop[]" },
107
{ u"asdfghjkl;@~" },
108
{ u"zxcvbnm,./?¥¥" },
109
},
110
{
111
// Latin Full-width Uppercase
112
{ u"!@#$%^&*()_+" },
113
{ u"QWERTYUIOP{}" },
114
{ u"ASDFGHJKL:¥”‘" },
115
{ u"ZXCVBNM<>/?|" },
116
},
117
};
118
119
// Accessors, since for some reason we can't declare the above extern???
120
121
const wchar_t *KorCons() { return kor_cons; }
122
const wchar_t *KorVowel() { return kor_vowel; }
123
const wchar_t *KorLCons() { return kor_lcons; }
124
const wchar_t *JapDiacritics(int index) { return diacritics[index]; }
125
char16_t OskKeyAt(int keyboard, int row, int col) { return oskKeys[keyboard][row][col]; }
126
127