facebook pixel מדריך: פירוט שפת תכנות - מקלדת - ()Keyboard.release - www.4project.co.il
Main logo www.4project.co.il
כל הרכיבים לפרוייקט שלכם
עגלת קניות

העגלה ריקה

לקוחות נכבדים, אלה שעות הפעילות של המחסן במהלך פסח 2024:
ערב חג וחג ראשון (22-23/04) - המחסן סגור
חול המועד (24-25/04) - המחסן יפעל בין 8:00 עד 15:00
ערב חג וחג שני (28-29/04) - המחסן סגור
נחזור לפעילות רגילה ביום שלישי 30/04
חג שמח!

פירוט שפת תכנות - מקלדת - ()Keyboard.release


2022-06-14 09:09:33
פונקציית ()Keyboard.release משחררת כפתור מסויים שנלחץ לפני כן בעזרת פונקציה ()Keyboard.press.


תחביר

קוד: בחר הכל
Keyboard.release(key)

פרמטרים:
key - כפתור שצריך לשחרר

הפונקציה מחזירה את מספר המקשים ששוחררו.


דוגמה

קוד: בחר הכל
// use this option for OSX:
char ctrlKey = KEY_LEFT_GUI;
// use this option for Windows and Linux:
//  char ctrlKey = KEY_LEFT_CTRL; 

void setup() {
  // make pin 2 an input and turn on the
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(2, INPUT_PULLUP);
  // initialize control over the keyboard:
  Keyboard.begin();
}

void loop() {
  while (digitalRead(2) == HIGH) {
    // do nothing until pin 2 goes low
    delay(500);
  }
  delay(1000);
  // new document:
  Keyboard.press(ctrlKey);
  Keyboard.press('n');
  delay(100);
  Keyboard.release(ctrlKey);
  Keyboard.release('n');
  // wait for new window to open:
  delay(1000);
}



ראו גם:

()Keyboard.begin
()Keyboard.end
()Keyboard.press
()Keyboard.print
()Keyboard.println
()Keyboard.releaseAll
()Keyboard.write

מחלקות Mouse ו-Keyboard
פירוט שפת תכנות לסביבת Arduino


עמוד זה הוא תרגום של ()Keyboard.release לפי רישיון Creative Commons Attribution-ShareAlike 3.0.