π
<-
Chat plein-écran
[^]

Python getkey avec micropy

Programmation et implémentation d'algorithmes.

Python getkey avec micropy

Unread postby ptijoz » 19 Jan 2023, 12:44

j'essaie d'utiliser getkey() avec Micropy sur la casio 35+EII mais je n'y parviens pas... :mmm:
faire se déplacer un objet par exemple...
Quelqu'un aurait-il un exemple tout simple ?
Merci d'avance
Un peu poète, un peu geek, un peu écolo
User avatar
ptijoz
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 32.6%
 
Posts: 333
Images: 0
Joined: 17 Oct 2018, 15:38
Location: France Loir et Cher
Gender: Male
Calculator(s):
MyCalcs profile
Class: a la poursuite du vent et des etoiles.

Re: Python getkey avec micropy

Unread postby critor » 19 Jan 2023, 13:35

Voici par exemple :
Code: Select all
from xcas import getkey
KEY_AC, KEY_EXIT, KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN = 30015, 5, 0, 3, 1, 2
key = -1
while key != KEY_EXIT and key != KEY_AC:
  key = getkey()
  if key == KEY_LEFT:
    ...
  elif key == KEY_RIGHT:
    ...
  elif key == KEY_UP:
    ...
  elif key == KEY_DOWN:
    ...
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 42.6%
 
Posts: 41500
Images: 14703
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor


Return to Programmation

Who is online

Users browsing this forum: No registered users and 33 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1439 utilisateurs:
>1424 invités
>11 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)