PDA

View Full Version : Czech keyboard



morfeuski
11-08-2013, 12:45 PM
It is possible add czech keyboard support to teensyduino? Czech keyboard looks like in attached images. The problm is, that my scipts doesnt work, because of bad characters. For example, & is interpreted as 7, 1 as +, 7 as , and < as ?. I can use KEYPAD for numbers, but still can't simulate other keys as teensy doesnt support right ALT.

PaulStoffregen
11-08-2013, 01:57 PM
Are you using Teensy 2.0 or 3.0 ?

PaulStoffregen
11-08-2013, 02:10 PM
I need more information about the "dead keys" used.

This Microsoft page shows 1 dead key without modifies, 2 with shift, and 11 with AltGr.

http://msdn.microsoft.com/en-us/goglobal/bb964651.aspx

The really confusing part is some dead keys seem to be duplicated. The acute accept one is show to the left of backspace without modifiers, but it's also the '9' key with AltGr. Likewise, the Caron dead key is shown twice. I need to know which ones are really used? Or is the info on that Microsoft page just wrong?

PaulStoffregen
11-08-2013, 03:33 PM
Ok, here's my first (very rough) attempt, with the info I currently have...

To use this, put keylayouts.h into hardware/teensy/cores/teensy3

Then edit hardware/teensy/boards.txt. Add these lines:



teensy3.menu.keys.usint.name=Czech
teensy3.menu.keys.usint.build.define1=-DLAYOUT_CZECH


Please let me know if this works?

PaulStoffregen
11-08-2013, 03:35 PM
These are the keycodes where I had to guess. Please try Keyboard.print() with these characters.



#define DEADKEY_ACUTE_ACCENT KEY_EQUAL // TODO: is it KEY_9 + ALTGR_MASK
#define DEADKEY_DEGREE_SIGN KEY_TILDE + SHIFT_MASK // TODO: is it KEY_5 + ALTGR_MASK
#define DEADKEY_CARON KEY_EQUAL + SHIFT_MASK // TODO: is it KEY_2 + ALTGR_MASK

#define ASCII_2A KEY_SLASH + ALTGR_MASK // 42 * TODO: verify
#define ASCII_2D KEY_SLASH // 45 - TODO: verify
#define ASCII_5E CIRCUMFLEX_BITS + KEY_SPACE // 94 ^ TODO: verify
#define ASCII_5F KEY_SLASH + SHIFT_MASK // 95 _ TODO: verify
#define ASCII_60 GRAVE_ACCENT_BITS + KEY_SPACE // 96 ` TODO: verify
#define ASCII_7E KEY_1 + ALTGR_MASK // 126 ~ TODO: verify

PaulStoffregen
11-08-2013, 09:53 PM
Opps, here's the correct lines to put into hardware/teensy/boards.txt:



teensy3.menu.keys.cz-cz.name=Czech
teensy3.menu.keys.cz-cz.build.define1=-DLAYOUT_CZECH

morfeuski
11-11-2013, 12:23 PM
Tensy 2.0++

morfeuski
11-11-2013, 12:39 PM
As I actually have Teensy++ I copied keylaouts to hardware/teensy/cores/teensy a I change your lines to
teensypp2.menu.keys.cz-cz.name=Czech
teensypp2.menu.keys.cz-cz.build.define1=-DLAYOUT_CZECH
It is right?

morfeuski
11-11-2013, 01:14 PM
So I tried this program
/* USB Keyboard Layout Test

You must select Keyboard from the "Tools > USB Type" menu

Select the the correct layout from "Tools > Keyboard Layout"

If you discover incorrect results for your country's layout,
please email Paul Stoffregen <paul@pjrc.com> with the results
of this test and an explanation of which keys are wrong. If
your layout is not available, please find the layout which
is closest, and email Paul Stoffregen.
*/

const int ledPin = 6; // Teensy 2.0 = Pin 11, Teensy++ 2.0 = Pin 6

void setup() {
Serial.begin(9600);

// Blink the LED for 10 seconds, to give time to open
// a word processor or text editor to receive the test
pinMode(ledPin, OUTPUT);
for (int i=0; i < 10; i++) {
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
}

// Type all possible characters. Many countries do not use all
// characters. Unsupported characters will be skipped
//
Keyboard.println("Teensy USB Keyboard Layout Test");
delay(100);
Keyboard.println("Lowercase: abcdefghijklmnopqrstuvwxyz");
delay(100);
Keyboard.println("Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ");
delay(100);
Keyboard.println("Numbers: 0123456789");
delay(100);
Keyboard.println("Symbols1: !\"#$%&'()*+,-./");
delay(100);
Keyboard.println("Symbols2: :;<=>?[\\]^_`{|}~");
delay(100);
Keyboard.println("Symbols3: *");
delay(100);
Keyboard.println("Symbols4: ");
delay(100);
Keyboard.println("Grave: ");
delay(100);
Keyboard.println("Acute: ");
delay(100);
Keyboard.println("Circumflex: ");
delay(100);
Keyboard.println("Tilde: ");
delay(100);
Keyboard.println("Diaeresis: ");
delay(100);
Keyboard.println("Cedilla: ");
delay(100);
Keyboard.println("Ring Above: ");
delay(100);
Keyboard.println("AE: ");
delay(100);
Keyboard.println("Thorn: ");
delay(100);
Keyboard.println("Sharp S: ");
delay(100);
Keyboard.println("O-Stroke: ");
delay(100);
Keyboard.println("Eth: ");
delay(100);
Keyboard.println("Euro: €");
}

void loop() {
// Do nothing after the test
}
With this outpput
Teensy USB Keyboard Layout Test
Lowercase: abcdefghijklmnopqrstuvwxyz
Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Numbers: 0123456789
Symbols1: !#$%&|()*+,-./
Symbols2: :;<=>?[\]# _& {|}!
Symbols3: /\
Symbols4: ][
Grave: &A&E&I&O&U&a&e&i&o&u
Acute:
Circumflex: #A#E#I#O#U#a#e#i#o#u
Tilde:
Diaeresis: \A\E\I\O\U\a\e\i\o\u\y
Cedilla:
Ring Above:
AE:
Thorn:
Sharp S: '
O-Stroke:
Eth:
Euro:

morfeuski
11-11-2013, 01:53 PM
I already tried my script and its now working. Thank you so much for your quick help and response.

PaulStoffregen
11-11-2013, 01:59 PM
Well, it looks like most of the characters are working.

Can you please tell me how you type these characters on your keyboard?

^

`

~






morfeuski
11-11-2013, 02:11 PM
^ altGr 3
` altGr 7
~ altGr+
altGr
altGr)
altGr

PaulStoffregen
11-12-2013, 12:18 PM
Here is another update to keylayouts.h. I've tried to fix the characters that printed incorrectly in the reply #9 above.

Please let me know how this works for you? Can you try those 6 keys individually?

morfeuski
05-05-2014, 12:47 PM
Here is another update to keylayouts.h. I've tried to fix the characters that printed incorrectly in the reply #9 above.

Please let me know how this works for you? Can you try those 6 keys individually?

Dear Paul, sorry for my really late response. I tried all six characters and it looks like their are fine. Thank you very much, you saved my day ;-)