Gambas Documentation
Aperçu du Langage
À traduire
Code Snippets
Comment faire ...
Compilation et installation
Composants
gb
gb.args
gb.cairo
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.db
gb.db.form
gb.dbus
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.mdi
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gui
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.libxml
gb.media
gb.mysql
gb.net
gb.net.curl
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.option
gb.pcre
gb.pdf
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt5
gb.qt5.opengl
gb.report
gb.scanner
gb.sdl
.Joystick
Desktop
Draw
Fill
Font
Image
Joystick
Joysticks
Key
Line
Mouse
Window
_new
Activate
Caption
Clear
Close
Close
Deactivate
Draw
Enter
Fill
Framerate
FullScreen
Height
Id
JoyAxisMove
KeyPress
KeyRelease
Leave
Mouse
MouseDown
MouseMove
MouseUp
Open
Refresh
Resizable
Resize
Show
Shown
Text
Title
Tracking
Update
Width
gb.sdl.sound
gb.settings
gb.signal
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Derniers changements
Dépôt d'applications
Documentation de l'Environnement de développement
Documentation des développeurs
Documents
Indenter
Index de tous les Documents
Index du langage
Lexique
LISEZ-MOI
Manuel du wiki
Messages d'erreur
Tutoriels
Wiki License

Event Window.KeyPress (gb.sdl)

Event KeyPress ( )

Est levé si une touche est pressée pendant que le contrôle a le focus.

Vous obtenez les informations concernant la touche pressée avec la classe Key.

Exemple

PUBLIC SUB screen_KeyPress()

  ' Déplace le joueur en utilisant les touches flèches
  IF (Key.Code = Key.Up) THEN MoveY = 1
  IF (Key.Code = Key.Down) THEN MoveY = -1
  IF (Key.Code = Key.Left) THEN MoveX = -1
  IF (Key.Code = Key.Right) THEN MoveX = 1

END