Skip to content

Commit f570bde

Browse files
authored
Merge pull request #100 from samuelstj/master
Add Brazilian Portuguese keyboard layout
2 parents 3172e2a + 7aaa02b commit f570bde

File tree

3 files changed

+179
-0
lines changed

3 files changed

+179
-0
lines changed

src/Keyboard.h

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ extern const uint8_t KeyboardLayout_en_US[];
116116
extern const uint8_t KeyboardLayout_es_ES[];
117117
extern const uint8_t KeyboardLayout_fr_FR[];
118118
extern const uint8_t KeyboardLayout_it_IT[];
119+
extern const uint8_t KeyboardLayout_pt_BR[];
119120
extern const uint8_t KeyboardLayout_pt_PT[];
120121
extern const uint8_t KeyboardLayout_sv_SE[];
121122
extern const uint8_t KeyboardLayout_da_DK[];

src/KeyboardLayout_pt_BR.cpp

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
* Brazilian Portuguese keyboard layout.
3+
*/
4+
5+
#include "KeyboardLayout.h"
6+
7+
extern const uint8_t KeyboardLayout_pt_BR[128] PROGMEM =
8+
{
9+
0x00, // NUL
10+
0x00, // SOH
11+
0x00, // STX
12+
0x00, // ETX
13+
0x00, // EOT
14+
0x00, // ENQ
15+
0x00, // ACK
16+
0x00, // BEL
17+
0x2a, // BS Backspace
18+
0x2b, // TAB Tab
19+
0x28, // LF Enter
20+
0x00, // VT
21+
0x00, // FF
22+
0x00, // CR
23+
0x00, // SO
24+
0x00, // SI
25+
0x00, // DEL
26+
0x00, // DC1
27+
0x00, // DC2
28+
0x00, // DC3
29+
0x00, // DC4
30+
0x00, // NAK
31+
0x00, // SYN
32+
0x00, // ETB
33+
0x00, // CAN
34+
0x00, // EM
35+
0x00, // SUB
36+
0x00, // ESC
37+
0x00, // FS
38+
0x00, // GS
39+
0x00, // RS
40+
0x00, // US
41+
42+
0x2c, // ' '
43+
0x1e|SHIFT, // !
44+
0x35|SHIFT, // "
45+
0x20|SHIFT, // #
46+
0x21|SHIFT, // $
47+
0x22|SHIFT, // %
48+
0x24|SHIFT, // &
49+
0x35, // '
50+
0x26|SHIFT, // (
51+
0x27|SHIFT, // )
52+
0x25|SHIFT, // *
53+
0x2E|SHIFT, // +
54+
0x36, // ,
55+
0x2D, // -
56+
0x37, // .
57+
0x14|ALT_GR, // /
58+
0x27, // 0
59+
0x1e, // 1
60+
0x1f, // 2
61+
0x20, // 3
62+
0x21, // 4
63+
0x22, // 5
64+
0x23, // 6
65+
0x24, // 7
66+
0x25, // 8
67+
0x26, // 9
68+
0x38|SHIFT, // :
69+
0x38, // ;
70+
0x36|SHIFT, // <
71+
0x2e, // =
72+
0x37|SHIFT, // >
73+
0x1a|ALT_GR, // ?
74+
0x1f|SHIFT, // @
75+
0x04|SHIFT, // A
76+
0x05|SHIFT, // B
77+
0x06|SHIFT, // C
78+
0x07|SHIFT, // D
79+
0x08|SHIFT, // E
80+
0x09|SHIFT, // F
81+
0x0a|SHIFT, // G
82+
0x0b|SHIFT, // H
83+
0x0c|SHIFT, // I
84+
0x0d|SHIFT, // J
85+
0x0e|SHIFT, // K
86+
0x0f|SHIFT, // L
87+
0x10|SHIFT, // M
88+
0x11|SHIFT, // N
89+
0x12|SHIFT, // O
90+
0x13|SHIFT, // P
91+
0x14|SHIFT, // Q
92+
0x15|SHIFT, // R
93+
0x16|SHIFT, // S
94+
0x17|SHIFT, // T
95+
0x18|SHIFT, // U
96+
0x19|SHIFT, // V
97+
0x1a|SHIFT, // W
98+
0x1b|SHIFT, // X
99+
0x1c|SHIFT, // Y
100+
0x1d|SHIFT, // Z
101+
0x30, // [
102+
0x32, // bslash
103+
0x31, // ]
104+
0x00, // ^ not supported (requires dead key + space)
105+
0x2d|SHIFT, // _
106+
0x00, // ` not supported (requires dead key + space)
107+
0x04, // a
108+
0x05, // b
109+
0x06, // c
110+
0x07, // d
111+
0x08, // e
112+
0x09, // f
113+
0x0a, // g
114+
0x0b, // h
115+
0x0c, // i
116+
0x0d, // j
117+
0x0e, // k
118+
0x0f, // l
119+
0x10, // m
120+
0x11, // n
121+
0x12, // o
122+
0x13, // p
123+
0x14, // q
124+
0x15, // r
125+
0x16, // s
126+
0x17, // t
127+
0x18, // u
128+
0x19, // v
129+
0x1a, // w
130+
0x1b, // x
131+
0x1c, // y
132+
0x1d, // z
133+
0x30|SHIFT, // {
134+
0x32|SHIFT, // |
135+
0x31|SHIFT, // }
136+
0x00, // ~ not supported (requires dead key + space)
137+
0x00 // DEL
138+
};

src/Keyboard_pt_BR.h

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
Keyboard_pt_BR.h
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef KEYBOARD_PT_BR_h
20+
#define KEYBOARD_PT_BR_h
21+
22+
#include "HID.h"
23+
24+
#if !defined(_USING_HID)
25+
26+
#warning "Using legacy HID core (non pluggable)"
27+
28+
#else
29+
30+
//================================================================================
31+
//================================================================================
32+
// Keyboard
33+
34+
// pt_BR keys
35+
#define KEY_ACUTE (136+0x2f)
36+
#define KEY_C_CEDILLA (136+0x33)
37+
#define KEY_TILDE (136+0x34)
38+
39+
#endif
40+
#endif

0 commit comments

Comments
 (0)