?Echange Des Boutton Du Claviers?

SoulHnt Messages postés 3 Date d'inscription samedi 14 avril 2007 Statut Membre Dernière intervention 4 février 2008 - 4 févr. 2008 à 07:57
SoulHnt Messages postés 3 Date d'inscription samedi 14 avril 2007 Statut Membre Dernière intervention 4 février 2008 - 4 févr. 2008 à 17:59
J'ai une question...
Bon je voudrais savoir quelle sont les codes simple pour changer les boutton, Exmp:

[SHIFT] a [SPACE] et que ceci continue a fonctionnee meme si le "FOCUS" n'est pas sur la fenetre, exemple sur un jeux au lieux.

Merci

~SoulHunter~

6 réponses

cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
4 févr. 2008 à 08:21
Hooking ?

Dans un module :

Option Explicit

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" _
(ByVal idHook As E_idHook, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long

Public Enum E_idHook
 WH_CALLWNDPROC = 4
 WH_CALLWNDPROCRET = 12
 WH_CBT = 5
 WH_DEBUG = 9
 WH_GETMESSAGE = 3
 WH_JOURNALPLAYBACK = 1
 WH_JOURNALRECORD = 0
 WH_KEYBOARD = 2
 WH_MOUSE = 7
 WH_MSGFILTER = -1
 WH_SHELL = 10
 WH_SYSMSGFILTER = 6
End Enum

Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Public KB_HookId As Long , ----
[code.aspx?ID=41455 Colorisation syntaxique par Renfield]
Dans un form :

Private Sub cmd_StartHooking_Click()
 mod_Hooking.KB_HookId = mod_Hooking.SetWindowsHookEx(WH_KEYBOARD, AddressOf KB_HookFnc, App.hInstance, 0)
End Sub<hr />
Private Sub cmd_StopHooking_Click()
 mod_Hooking.UnhookWindowsHookEx mod_Hooking.KB_HookId
End Sub<hr />Private Sub Form_Unload(Cancel As Integer)
 Call cmd_StopHooking_Click
End Sub , ----
[code.aspx?ID=41455 Colorisation syntaxique par Renfield]

_______________________________________________________________________
VB.NETis good ...VB6is better
0
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
4 févr. 2008 à 08:24
Oups j'ai oublié la fonction KB_HookFnc :

Public Function KB_HookFnc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
 'Voici la fonction qui va traiter les messages filtrés par le hook.
 Dim tmp As String
 With frm_Prog
  Select Case wParam
   Case 8: tmp = "[BackSpace]"
   Case 9: tmp = "[Tab]"
   Case 13: tmp = "[Enter]"
   Case 16: tmp = "[Shift]"
   Case 17: tmp = "[Ctrl]"
   Case 18: tmp = "[Alt]"
   Case 27: tmp = "[Escape]"
   Case 32: tmp = "[Space]"
   Case 48 To 57: tmp = Chr(wParam)
   Case 65 To 90: tmp = Chr(wParam)
   Case 112 To 123: tmp = "[F*]"
   Case Else
    tmp = Chr(wParam) & " - " & wParam
  End Select
  .txt_Hooking.Text = .txt_Hooking.Text & tmp & vbCrLf  KB_HookFnc -1 '-1 Null
 End With
End Function , ----
[code.aspx?ID=41455 Colorisation syntaxique par Renfield]

_______________________________________________________________________
VB.NETis good ...VB6is better
0
SoulHnt Messages postés 3 Date d'inscription samedi 14 avril 2007 Statut Membre Dernière intervention 4 février 2008
4 févr. 2008 à 10:22
Pourriez vous ou quelqu'un faire un exemplair en code source et le uploader?
Pcq sa fait 1ans et demi jai rien fait avec VB lol, et suposement il aurait un erreur... =(
Dans le fond ce que j'aimerais avoir c'est comme un confuguration de boutton pour manette mais avec le clavier pour certain jeux que jveut jouer. Pour Definir une certaine touche a un autre.

Expl.:
        Shift = Space
        Ctrl = Alt
        Ect...

Merci, Et Merci de Repondre Auss Vite. =D
~SoulHunter~
0
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
4 févr. 2008 à 11:33
[%09http://rapidshare.com/files/89052402/testSubCl.zip.html Là]


_______________________________________________________________________


VB.NET
is good ...
VB6
is better
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
4 févr. 2008 à 11:44
oups lien pourri ... ici
_______________________________________________________________________
VB.NETis good ...VB6is better
0
SoulHnt Messages postés 3 Date d'inscription samedi 14 avril 2007 Statut Membre Dernière intervention 4 février 2008
4 févr. 2008 à 17:59
Merci Beaucoup. =D
~SoulHunter~
0
Rejoignez-nous