FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
bibliothèque des touches du clavier Emptypar papydall Aujourd'hui à 16:57

» PANORAMIC V 1
bibliothèque des touches du clavier Emptypar papydall Aujourd'hui à 3:22

» select intégrés [résolu]
bibliothèque des touches du clavier Emptypar jjn4 Hier à 17:00

» number_mouse_up
bibliothèque des touches du clavier Emptypar jjn4 Hier à 11:59

» Aide de PANORAMIC
bibliothèque des touches du clavier Emptypar jjn4 Hier à 11:16

» trop de fichiers en cours
bibliothèque des touches du clavier Emptypar lepetitmarocain Hier à 10:43

» Je teste PANORAMIC V 1 beta 1
bibliothèque des touches du clavier Emptypar papydall Hier à 4:17

» bouton dans autre form que 0
bibliothèque des touches du clavier Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
bibliothèque des touches du clavier Emptypar Klaus Lun 6 Mai 2024 - 11:41

» Gestion d'un système client-serveur.
bibliothèque des touches du clavier Emptypar Klaus Lun 6 Mai 2024 - 10:23

» @Jack
bibliothèque des touches du clavier Emptypar Jack Mar 30 Avr 2024 - 20:40

» Une calculatrice en une ligne de programme
bibliothèque des touches du clavier Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
bibliothèque des touches du clavier Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
bibliothèque des touches du clavier Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
bibliothèque des touches du clavier Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le Deal du moment : -20%
Ecran PC GIGABYTE 28″ LED M28U 4K ( IPS, 1 ms, ...
Voir le deal
399 €

 

 bibliothèque des touches du clavier

Aller en bas 
AuteurMessage
jimx78

jimx78


Nombre de messages : 241
Age : 32
Localisation : Yvelines
Date d'inscription : 24/05/2010

bibliothèque des touches du clavier Empty
MessageSujet: bibliothèque des touches du clavier   bibliothèque des touches du clavier EmptyDim 17 Avr 2011 - 0:04

Bonjour a tous,

J'ai fait une bibliothèque pour les touches du clavier.

Heu et ca sert a quoi?? Rolling Eyes

Cela sert a savoir en temps réel quel touche est appuyer. (Très pratique pour les jeux 2D 3D)
On peut également appuyer sur plusieurs touche en même temps.

Et c'est compliqué a utiliser? Neutral

Pas du tout, il y a trois chose a savoir:
1) Il faut inclure le fichier par cette ligne:
Code:
#include "b_touche.bas"

2) Il faut le placer JUSTE avant le "end" dans votre programme.

3) Il est très conseiller d'utiliser un "timer" avec une "timer_interval" de 1. Dans ce sous programme, il suffit d'écrire:
Code:
if touche_echap = 1 then terminate

Arrow Si la touche est enfoncer, alors touche_echap = 1 sinon 0.


Et comment je connait le nom de toute les commande?? confused

Il sont au début de la bibliothèque. Ils sont également très simple a retenir; exemple :
touche_m ; touche_espace ; touche_3 ; touche_pn_5 ... (pavé numérique)



Voici la bibliothèque a renommer en "b_touche.bas" pour que l'exemple ci dessous fonctionne:
Code:

' Bibliothèque des touches
' crée par Jimx78

' Touche a à z
dim touche_a
dim touche_b
dim touche_c
dim touche_d
dim touche_e
dim touche_f
dim touche_g
dim touche_h
dim touche_i
dim touche_j
dim touche_k
dim touche_l
dim touche_m
dim touche_n
dim touche_o
dim touche_p
dim touche_q
dim touche_r
dim touche_s
dim touche_t
dim touche_u
dim touche_v
dim touche_w
dim touche_x
dim touche_y
dim touche_z
' Touche de haut en bas
dim touche_echap
dim touche_f1
dim touche_f2
dim touche_f3
dim touche_f4
dim touche_f5
dim touche_f6
dim touche_f7
dim touche_f8
dim touche_f9
dim touche_f10
dim touche_f11
dim touche_f12
dim touche_inser
dim touche_suppr
dim touche_1
dim touche_2
dim touche_3
dim touche_4
dim touche_5
dim touche_6
dim touche_7
dim touche_8
dim touche_9
dim touche_0
dim touche_retour
dim touche_enter
dim touche_maj_ver
dim touche_maj
dim touche_ctrl
dim touche_alt
dim touche_espace
dim touche_gauche
dim touche_haut
dim touche_droit
dim touche_bas
' Les touches du pavé numerique
dim touche_fin
dim touche_pause
dim touche_page_haut
dim touche_page_bas
dim touche_ver_num
dim touche_slash
dim touche_etoile
dim touche_moins
dim touche_plus
dim touche_virgule
dim touche_pn_1
dim touche_pn_2
dim touche_pn_3
dim touche_pn_4
dim touche_pn_5
dim touche_pn_6
dim touche_pn_7
dim touche_pn_8
dim touche_pn_9
dim touche_pn_0

label bibiotheque_touche_1 , bibiotheque_touche_2
on_key_down 0,bibiotheque_touche_1
on_key_up 0,bibiotheque_touche_2
end

bibiotheque_touche_1:
if key_down_code = 65 then touche_a=1
if key_down_code = 66 then touche_b=1
if key_down_code = 67 then touche_c=1
if key_down_code = 68 then touche_d=1
if key_down_code = 69 then touche_e=1
if key_down_code = 70 then touche_f=1
if key_down_code = 71 then touche_g=1
if key_down_code = 72 then touche_h=1
if key_down_code = 73 then touche_i=1
if key_down_code = 74 then touche_j=1
if key_down_code = 75 then touche_k=1
if key_down_code = 76 then touche_l=1
if key_down_code = 77 then touche_m=1
if key_down_code = 78 then touche_n=1
if key_down_code = 79 then touche_o=1
if key_down_code = 80 then touche_p=1
if key_down_code = 81 then touche_q=1
if key_down_code = 82 then touche_r=1
if key_down_code = 83 then touche_s=1
if key_down_code = 84 then touche_t=1
if key_down_code = 85 then touche_u=1
if key_down_code = 86 then touche_v=1
if key_down_code = 87 then touche_w=1
if key_down_code = 88 then touche_x=1
if key_down_code = 89 then touche_y=1
if key_down_code = 90 then touche_z=1
if key_down_code = 27 then touche_echap=1
if key_down_code = 112 then touche_f1=1
if key_down_code = 113 then touche_f2=1
if key_down_code = 114 then touche_f3=1
if key_down_code = 115 then touche_f4=1
if key_down_code = 116 then touche_f5=1
if key_down_code = 117 then touche_f6=1
if key_down_code = 118 then touche_f7=1
if key_down_code = 119 then touche_f8=1
if key_down_code = 120 then touche_f9=1
if key_down_code = 121 then touche_f10=1
if key_down_code = 122 then touche_f11=1
if key_down_code = 123 then touche_f12=1
if key_down_code = 45 then touche_inser=1
if key_down_code = 46 then touche_suppr=1
if key_down_code = 49 then touche_1=1
if key_down_code = 50 then touche_2=1
if key_down_code = 51 then touche_3=1
if key_down_code = 52 then touche_4=1
if key_down_code = 53 then touche_5=1
if key_down_code = 54 then touche_6=1
if key_down_code = 55 then touche_7=1
if key_down_code = 56 then touche_8=1
if key_down_code = 57 then touche_9=1
if key_down_code = 48 then touche_0=1
if key_down_code = 8 then touche_retour=1
if key_down_code = 13 then touche_enter=1
if key_down_code = 20 then touche_maj_ver=1
if key_down_code = 16 then touche_maj=1
if key_down_code = 17 then touche_ctrl=1
if key_down_code = 18 then touche_alt=1
if key_down_code = 32 then touche_espace=1
if key_down_code = 37 then touche_gauche=1
if key_down_code = 38 then touche_haut=1
if key_down_code = 39 then touche_droit=1
if key_down_code = 40 then touche_bas=1
if key_down_code = 35 then touche_fin=1
if key_down_code = 19 then touche_pause=1
if key_down_code = 33 then touche_page_haut=1
if key_down_code = 34 then touche_page_bas=1
if key_down_code = 144 then touche_ver_num=1
if key_down_code = 111 then touche_slash=1
if key_down_code = 106 then touche_etoile=1
if key_down_code = 109 then touche_moins=1
if key_down_code = 107 then touche_plus=1
if key_down_code = 110 then touche_virgule=1
if key_down_code = 97 then touche_pn_1=1
if key_down_code = 98 then touche_pn_2=1
if key_down_code = 99 then touche_pn_3=1
if key_down_code = 100 then touche_pn_4=1
if key_down_code = 101 then touche_pn_5=1
if key_down_code = 102 then touche_pn_6=1
if key_down_code = 103 then touche_pn_7=1
if key_down_code = 104 then touche_pn_8=1
if key_down_code = 105 then touche_pn_9=1
if key_down_code = 96 then touche_pn_0=1
return

bibiotheque_touche_2:
if key_up_code = 65 then touche_a=0
if key_up_code = 66 then touche_b=0
if key_up_code = 67 then touche_c=0
if key_up_code = 68 then touche_d=0
if key_up_code = 69 then touche_e=0
if key_up_code = 70 then touche_f=0
if key_up_code = 71 then touche_g=0
if key_up_code = 72 then touche_h=0
if key_up_code = 73 then touche_i=0
if key_up_code = 74 then touche_j=0
if key_up_code = 75 then touche_k=0
if key_up_code = 76 then touche_l=0
if key_up_code = 77 then touche_m=0
if key_up_code = 78 then touche_n=0
if key_up_code = 79 then touche_o=0
if key_up_code = 80 then touche_p=0
if key_up_code = 81 then touche_q=0
if key_up_code = 82 then touche_r=0
if key_up_code = 83 then touche_s=0
if key_up_code = 84 then touche_t=0
if key_up_code = 85 then touche_u=0
if key_up_code = 86 then touche_v=0
if key_up_code = 87 then touche_w=0
if key_up_code = 88 then touche_x=0
if key_up_code = 89 then touche_y=0
if key_up_code = 90 then touche_z=0
if key_up_code = 27 then touche_echap=0
if key_up_code = 112 then touche_f1=0
if key_up_code = 113 then touche_f2=0
if key_up_code = 114 then touche_f3=0
if key_up_code = 115 then touche_f4=0
if key_up_code = 116 then touche_f5=0
if key_up_code = 117 then touche_f6=0
if key_up_code = 118 then touche_f7=0
if key_up_code = 119 then touche_f8=0
if key_up_code = 120 then touche_f9=0
if key_up_code = 121 then touche_f10=0
if key_up_code = 122 then touche_f11=0
if key_up_code = 123 then touche_f12=0
if key_up_code = 45 then touche_inser=0
if key_up_code = 46 then touche_suppr=0
if key_up_code = 49 then touche_1=0
if key_up_code = 50 then touche_2=0
if key_up_code = 51 then touche_3=0
if key_up_code = 52 then touche_4=0
if key_up_code = 53 then touche_5=0
if key_up_code = 54 then touche_6=0
if key_up_code = 55 then touche_7=0
if key_up_code = 56 then touche_8=0
if key_up_code = 57 then touche_9=0
if key_up_code = 48 then touche_0=0
if key_up_code = 8 then touche_retour=0
if key_up_code = 13 then touche_enter=0
if key_up_code = 20 then touche_maj_ver=0
if key_up_code = 16 then touche_maj=0
if key_up_code = 17 then touche_ctrl=0
if key_up_code = 18 then touche_alt=0
if key_up_code = 32 then touche_espace=0
if key_up_code = 37 then touche_gauche=0
if key_up_code = 38 then touche_haut=0
if key_up_code = 39 then touche_droit=0
if key_up_code = 40 then touche_bas=0
if key_up_code = 35 then touche_fin=0
if key_up_code = 19 then touche_pause=0
if key_up_code = 33 then touche_page_haut=0
if key_up_code = 34 then touche_page_bas=0
if key_up_code = 144 then touche_ver_num=0
if key_up_code = 111 then touche_slash=0
if key_up_code = 106 then touche_etoile=0
if key_up_code = 109 then touche_moins=0
if key_up_code = 107 then touche_plus=0
if key_up_code = 110 then touche_virgule=0
if key_up_code = 97 then touche_pn_1=0
if key_up_code = 98 then touche_pn_2=0
if key_up_code = 99 then touche_pn_3=0
if key_up_code = 100 then touche_pn_4=0
if key_up_code = 101 then touche_pn_5=0
if key_up_code = 102 then touche_pn_6=0
if key_up_code = 103 then touche_pn_7=0
if key_up_code = 104 then touche_pn_8=0
if key_up_code = 105 then touche_pn_9=0
if key_up_code = 96 then touche_pn_0=0
return

Et un exemple,
(Il faut mettre les deux fichier dans le même répertoire)
Code:
border_hide 0 : full_space 0
scene3d 1 : full_space 1 : color 1,40,120,255
label programme
3d_cube 1,0.5
timer 2 : timer_interval 2,1 : on_timer 2,programme : timer_on 2
#include "b_touche.bas"
end

programme:
if touche_echap = 1 then timer_off 2 : terminate
if touche_haut = 1
3d_move 1,0.08
end_if
if touche_droit = 1
3d_y_rotate 1,o3d_y_rotate(1)-1
end_if
if touche_gauche = 1
3d_y_rotate 1,o3d_y_rotate(1)+1
end_if
if touche_bas = 1
3d_move 1,(-0.08)
end_if
return

Si vous avez des questions ou des remarques ne vous gêné pas. cheers
Revenir en haut Aller en bas
 
bibliothèque des touches du clavier
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» gestion d'une bibliothéque
» Bibliothèque de Subs (suite)
» Bibliothèque de sous-programmes
» clavier de piano et notes
» V2.57 du 25/11/2013 - bibliothèque personnelle pour Toolbar

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: