Jump to content

Tian Dan

Active Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Tian Dan

  1. Thanks for that, Paul. But already I'm running into the next road block. For some reason the "println"-functionality doesn't work in my arduino environment. It does print out the letters and numbers but it doesn't do the line break at the end. Several "println"-commands one after the other just produce continuous textflow without line breaks. My first guess is that the println-function contains some kind of appended Enter-Keypress-thingy that also doesn't work with german keyboards. Could that be?
  2. Couldn't stop myself and ran the test in cat-on-keyboard-mode. Did this void setup () { delay(2500); Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.set_key1(KEY_R); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("notepad.exe"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(2000); Keyboard.print("testing german keyboard layout"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //this should look like so: abcdefghijklmnopqrstuvwxyzäöü<,.-#+ Keyboard.print("abcdefghijklmnopqrstuvwxyzäöü<,.-#+"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //SHIFT: this should look like so: ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ>;:_'* Keyboard.print("ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ>;:_'*"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //this should look like so: 1234567890ß Keyboard.print("1234567890ß"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //SHIFT: this should look like so: !"§$%&/()=? Keyboard.print("!\"§$%&/()=?"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //ALTGR: this should look like so: ¹²³¼½¬{[]}\@€| Keyboard.print("¹²³¼½¬\{\[]}\\@€|"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); //ALT+TAB Keyboard.set_modifier(MODIFIERKEY_ALT); Keyboard.set_key1(KEY_TAB); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(2000); Keyboard.set_modifier(MODIFIERKEY_ALT); Keyboard.set_key1(KEY_TAB); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); } void loop () { } Came out almost perfectly, even ALT+TAB works perfectly. The only thing missing is "ß", which is the unmodified version of the question mark and the backslash, the key to the right of the zero key (on german keyboards). It''s a german specialty and afaik never used in computer/programming context.
  3. Works great. Tried the alpha version and get the characters I want in Linux (Ubuntu 10.04 german) as well as in Windows (7). Did this void setup () { delay(2500); Keyboard.set_modifier(MODIFIERKEY_GUI); Keyboard.set_key1(KEY_R); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("notepad.exe"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(2000); Keyboard.print("testing german keyboard layout"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); Keyboard.print("this should be Zeppelin: z"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); Keyboard.print("this should be Ypsilon: y"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); Keyboard.print("this should be forward slash: /"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); Keyboard.print("and now, hopefully backward slash: \\"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); Keyboard.print("oh,oh, one more. those bracket thingies: < and >"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1000); } void loop () { } and got exactly the expected behaviour and output, even those bracket thingies between the y and left shift keys. Thanks a lot for your effort. If you want me to do some more testing, let me know.
  4. Sorry for the late reply, hope it's still of use. Output of your code is the following: 5b6c7d8e9f10g11h12i13j14k15l16m17n18o19p20q21r22s23t24u25v26w27x28z29y3013123233 3434535636737838939040 41443 44 45ß46´47ü48+49#50#51ö52ä53^54,55.56-57%( After that the Windows Help opened (I suppose the Teensy send an F1-keystroke). In it's input line the following was entered: %)&=&!&"&§ Somewhere inbetween the Caps Lock key was switched on, I suspected after 57, so I changed the code and tested that and yes Keyboard.set_key1(57); Keyboard.send_now(); fires Caps Lock. So I changed the code again and made it count from 58 to 64 and then Notepad (which I use to see the output) opened the "Search"-Window (usually opened by F3). That's why I suppose after 57 come the F-keys. After that I got curious (looking for the forward and backward slashes) and let it run with SHIFT Modifier enabled. 5B6C7D8E9F10G11H12I13J14K15L16M17N18O19P20Q21R22S23T24U25V26W27X28Z29Y30!31"32§33$34%35&36/37(38)39=40 41443 44 45?46`47Ü48*49'50'51Ö52Ä53°54;55:56_ Forward slash after 36, yay! Then, looking for the Backslash, which is usually AltGr+ß on german keyboards, I tried with Keyboard.set_modifier(MODIFIERKEY_SHIFT | MODIFIERKEY_ALT) but notepad didn't like that and produced nothing but the index numbers. I couldn't find a modifier setting for the AltGr-Key in teensyduino's documentation. Do you even have this key on english keyboards? Anyways, I hope my uneducated poking around is of any use. Now I'm off to play around with the Linux-Alpha-Version. btw: Thanks a lot for that fun toy!
  5. A "Keyboard Layout"-Option would be great. Or maybe you could let the user specify which keycodes to send. That way we could map the key codes to the actual output ourselves. Instead of keyboard.set_key1(KEY_A) we could do keyboard.set_key1(HIDCODE). Being a total programming newbie I don't even know if that's possible or if I'm making sense at all, but hey... Anyways, I tried to the map the keystrokes send by the Teensy to the keystrokes defined in the Arduino-Code myself and this is what I came up with: void setup() { delay(5000); Keyboard.set_modifier(128); Keyboard.set_key1(KEY_R); Keyboard.send_now(); Keyboard.set_modifier(0); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("notepad.exe"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("abcdefghijklmnopqrstuvwxyz"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("1234567890ß"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("&lt;,.-öä#ü+"); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("!\"§$%&amp;/\()=?"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("&gt;;:_ÖÄ'Ü*"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("²³\{\[]}\\"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); Keyboard.print("|~"); Keyboard.send_now(); Keyboard.set_key1(KEY_ENTER); Keyboard.send_now(); Keyboard.set_key1(0); Keyboard.send_now(); delay(1500); } void loop() { } Output is the following: abcdefghijklmnopqrstuvwxzy 1234567890 ;,.ߧ` ABCDEFGHIJKLMNOPQRSTUVWXZY !Ä$%/-)=´_ :öÖ?ä( Üü+*# '° German keyboard layout and german locale in Windows. Since there are german characters in the output ('ä', 'Ü') there is obviously some strange mapping going on. And it doesn't work backwards, "<" comes out as ";", but ";" doesn't come out as "<" but as "ö".
×
×
  • Create New...