Go Down

Topic: how générate keyboard key "<" and ">" ? (Read 6804 times) previous topic - next topic

uxomm

#15
Aug 19, 2016, 02:47 am Last Edit: Aug 19, 2016, 02:49 am by uxomm
How to activate French keyboard layout in Arduino IDE with teensyduino add-on:

Always decouple electronic circuitry.

keokod

OH I'm very NOOOB !!

I no visible option keyboard langage in IDE arduino

now I have this <

Code: [Select]


Hel!
"
#
$
%

(
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M

P
S
T
U
V
W
Y
Z]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~


thank's for HELP me and be patient.
I can continue may keyboard , tank you again

uxomm

Oh yeah! :smiley-mr-green: :smiley-mr-green:

I wish you success with your project!

Always decouple electronic circuitry.

GoForSmoke

I think 1.6.5-r5 is pretty stable.
And I have always more than one versions in parallel on my computer - I use the zip file variants - so no installation is required.
We do the same and I haven't installed teensyduino in a good while now.

NI$HANT informed me that the Atmel studio has fewer quirks, I am tempted but can't share as much here.

I was wondering if you open a terminal emulator to capture the keystrokes, you might find emulator settings to avoid changing system settings.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

keokod

#19
Aug 20, 2016, 06:15 pm Last Edit: Aug 20, 2016, 06:36 pm by keokod
it's too longer , but i test one one key for not have a error

http://www.keyboardtester.com/tester.html

this is a preview my keyboard left cut metal  :smiley-roll-sweat: , i must kill 2 mécanique keyboard



uxomm

I was wondering if you open a terminal emulator to capture the keystrokes, you might find emulator settings to avoid changing system settings.
Yes, this might be possible and an option.
But as much as I understand the thread-opener he wants to make some kind of "two-part keyboard" that works with "every" application on (many) computers.
Maybe he wants to create something like a special "game controller", or a keyboard for a person with special needs (which I have done a few times), or just a "fancy keyboard" :) .
Always decouple electronic circuitry.

keokod

#21
Aug 22, 2016, 09:04 pm Last Edit: Aug 22, 2016, 09:39 pm by keokod
I'm have another problème ...
I try the key combo "^" and "e" for key "ê", but i didn't foud  :smiley-roll-blue:


I try this

Code: [Select]

        Keyboard.write(94); // ê touche accent circonflexe   

        Keyboard.set_key2(KEY_E); //touche minuscule querty en azerty

        Keyboard.send_now();


I have "^e" ...

edit I found it's     Keyboard.press(234); !

keokod

I finised my keyboard, but i have a little problème,
when i key press a button, sometime the key is not active, i must press another key,
géneraly when i presse the first char before note use keyboard.
Is USB is standby ?
For have note this problème , i must call press with interruption ?

uxomm

I do not think there is USB standby with the Teensy.

How can we know what is going on?

Please post your code.

And if you have a lot of code, try to write a short piece of code that concentrates on just illustrating the problem.
Always decouple electronic circuitry.

keokod

#24
Sep 05, 2016, 06:47 am Last Edit: Sep 05, 2016, 06:58 am by keokod
this my code


Code: [Select]

//CLAVIER GAUCHE V 1.1
#include "Keypad.h"

int appuye = 13; //témoin appuye touche
int shift = 26; //touche shift
int maj = 24; //led sortie majuscule actif

const byte COLS = 8;
const byte ROWS = 8;

char keys[ROWS][COLS] = {
    { ',', 'a', 's', 'S', '1', '}', '{', '#'}, //14
    { ';', 'b', 'r', 'R', '2', ']', '[', '`'}, //15
    { '"', 'c', 'n', 'N', '3', ')', '(', ' '}, //16   
    { '?', 'd', 'm', 'M', '4', '-', '/', 'e'}, //17 
    { '%', 'A', 'q', 'Q', '5', '>', '<', '|'}, //18
    { '*', 'B', 'g', 'G', '6', '=', '9',}, //19
    { '!', 'C', 'h', 'H', '7', ':', '0'}, //20 
    { '+', 'D', 'f', 'F', '8', '^', '_',}, //21
    //Bit  0 - 1 - 2 - 3 - 4 - 5 - 6 - 7
    //SHIFT bit entrée 10
};


byte colPins[COLS] = {0, 1, 2, 3, 4, 5, 6, 7};
byte rowPins[ROWS] = {14, 15, 16, 17, 18, 19, 20, 21};

Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void setup() {
    pinMode(maj, OUTPUT); // sets the digital pin as output
    pinMode(appuye, OUTPUT);
    pinMode(shift, INPUT_PULLUP);

}

void loop() {

    char key = keypad.getKey();
    int isShift = digitalRead(shift); // read the input pin

    if (isShift == 1) {
        digitalWrite(maj, LOW);
    } else {
        digitalWrite(maj, HIGH);
    }

    if (key != NO_KEY) {
       
        if (isShift == 0) //si on appuye sur shift la touche sera en majuscule
        {
            Keyboard.set_modifier(MODIFIERKEY_SHIFT); //reste appuyer sur shift
            Keyboard.set_key1(bepo(key)); //touche minuscule querty en azerty
            Keyboard.set_modifier(0);
        } else { //sinon touche minuscule
            Keyboard.set_key1(bepo(key)); //touche minuscule querty en azerty
        }
        /*
    Keyboard.set_modifier(0);

    Keyboard.set_key1(0);
*/
    Keyboard.send_now();
        Keyboard.releaseAll(); //vider toutes les memoires touches
        digitalWrite(appuye, HIGH);
        delay(20);
        digitalWrite(appuye, LOW);

    }

}


char bepo(char key) { //querty en azerty

    //___________________________________________COLONNE 2 __________________________________________________________



    // tabulation ^ b é p o è êa

    if (key == 's') {

        return KEY_TAB;

    }



    if (key == 'r') {

        Keyboard.write(94); // => ^
    return false;
    }

    if (key == 'n') {

        return KEY_B;

    }



    if (key == 'm') {

        Keyboard.press(KEY_2);
    return 0;


    }



    if (key == 'q') {

        return KEY_P;

    }



    if (key == 'g') {

        return KEY_O;

    }

    if (key == 'h') {

        Keyboard.press(KEY_7);

    return 0;

    }



    if (key == 'f') {

        Keyboard.press(234);
    return 0;
    }


//  ....another 50 key   ....             


    if (key == '|') {

        Keyboard.press(KEY_DOWN); // tréma
    return 0;

    }
    return 0;

}




no forget i used  2 keyboard 2 usb 2   teensy


my full code is here (is here forum no exceed 9000 char)

http://profoad.education/moodle3/mod/page/view.php?id=647


Go Up