.:~ Einen sehr langen VB6 Source Code kürzen… ~:.

  • VB

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • .:~ Einen sehr langen VB6 Source Code kürzen… ~:.

    Hallo,

    ich hab ein Echt GROßES Problem, denn ich wollte ein GamePad Tool Programmieren („GamePad2PC“), wo per Directinput die Ergebnisse in eine TextBox geschrieben werden,
    Wenn die taste gedrückt ist dann steht in der dazugehörigen Textbox „Down“ wenn nicht dann steht dort „Up“.
    Also mein Programm soll dann für die GamePad Taste eine Tastatur Taste Simulieren, ich wollte es aber nicht mit SendKeys machen und habe mich für die „keybd_event“ – API entschieden also Programmierte ich mir es für alle Tasten…
    Das Problem ist das mein Source Code für die Tasten Simulation schon ÜBER 1700 ZEILEN VERBRAUCHT!!!
    Deshalb wollte ich gerne wissen ob mir jemand sagen kann wie ich es kürzer und übersichtlicher machen kann, und ob ich das ganze nicht in ein Modul packen kann damit der „Reine Code“ nur ne paar Hundert Zeilen lang ist….

    DAS IST MEIN „MONSTER SOURCE CODE“ ;) :

    Quellcode

    1. Option Explicit
    2. Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    3. 'keybd_event dwFlags-Konstanten
    4. Private Const KEYEVENTF_EXTENDEDKEY = &H1 'Erweiterte Tastatureingabe
    5. Private Const KEYEVENTF_KEYUP = &H2 'Die angegebene Taste wird losgelassen
    6. 'GetAsyncKeyState vKey-Konstanten
    7. Private Const VK_BACK = &H8 'Backspace Taste
    8. Private Const VK_TAB = &H9 'Tab Taste
    9. Private Const VK_RETURN = &HD 'Enter Taste
    10. Private Const VK_SHIFT = &H10 'Shift Taste
    11. Private Const VK_CONTROL = &H11 'STRG Taste
    12. Private Const VK_MENU = &H12 'Alt Taste
    13. Private Const VK_PAUSE = &H13 'Pause/Untbr
    14. Private Const VK_CAPITAL = &H14 'Caps Lock/Feststelltaste
    15. Private Const VK_ESCAPE = &H1B 'Escape
    16. Private Const VK_SPACE = &H20 'Space/Leertaste
    17. Private Const VK_PRIOR = &H21 'PageUp/Bild hoch
    18. Private Const VK_NEXT = &H22 'PageDown/Bild runter
    19. Private Const VK_END = &H23 'Ende
    20. Private Const VK_HOME = &H24 'Home/Pos1
    21. Private Const VK_LEFT = &H25 'Linke Pfeiltaste
    22. Private Const VK_UP = &H26 'Obere Pfeilaste
    23. Private Const VK_RIGHT = &H27 'Rechte Pfeiltaste
    24. Private Const VK_DOWN = &H28 'Untee Pfeiltaste
    25. Private Const VK_SNAPSHOT = &H2C 'Drucken/S-Abf
    26. Private Const VK_INSERT = &H2D 'Einfügen
    27. Private Const VK_DELETE = &H2E 'Entfernen
    28. Private Const VK_0 = &H30 'Taste 0
    29. Private Const VK_1 = &H31 'Taste 1
    30. Private Const VK_2 = &H32 'Taste 2
    31. Private Const VK_3 = &H33 'Taste 3
    32. Private Const VK_4 = &H34 'Taste 4
    33. Private Const VK_5 = &H35 'Taste 5
    34. Private Const VK_6 = &H36 'Taste 6
    35. Private Const VK_7 = &H37 'Taste 7
    36. Private Const VK_8 = &H38 'Taste 8
    37. Private Const VK_9 = &H39 'Taste 9
    38. Private Const VK_A = &H41 'Taste A
    39. Private Const VK_B = &H42 'Taste B
    40. Private Const VK_C = &H43 'Taste C
    41. Private Const VK_D = &H44 'Taste D
    42. Private Const VK_E = &H45 'Taste E
    43. Private Const VK_F = &H46 'Taste F
    44. Private Const VK_G = &H47 'Taste G
    45. Private Const VK_H = &H48 'Taste H
    46. Private Const VK_I = &H49 'Taste I
    47. Private Const VK_J = &H4A 'Taste J
    48. Private Const VK_K = &H4B 'Taste K
    49. Private Const VK_L = &H4C 'Taste L
    50. Private Const VK_M = &H4D 'Taste M
    51. Private Const VK_N = &H4E 'Taste N
    52. Private Const VK_O = &H4F 'Taste O
    53. Private Const VK_P = &H50 'Taste P
    54. Private Const VK_Q = &H51 'Taste Q
    55. Private Const VK_R = &H52 'Taste R
    56. Private Const VK_S = &H53 'Taste S
    57. Private Const VK_T = &H54 'Taste T
    58. Private Const VK_U = &H55 'Taste U
    59. Private Const VK_V = &H56 'Taste V
    60. Private Const VK_W = &H57 'Taste W
    61. Private Const VK_X = &H58 'Taste X
    62. Private Const VK_Y = &H59 'Taste Y
    63. Private Const VK_Z = &H5A 'Taste Z
    64. Private Const VK_STARTKEY = &H5B 'Startmenütaste
    65. Private Const VK_CONTEXTKEY = &H5D 'Kentextmenü
    66. Private Const VK_NUMPAD0 = &H60 'Numpad Taste 0
    67. Private Const VK_NUMPAD1 = &H61 'Numpad Taste 1
    68. Private Const VK_NUMPAD2 = &H62 'Numpad Taste 2
    69. Private Const VK_NUMPAD3 = &H63 'Numpad Taste 3
    70. Private Const VK_NUMPAD4 = &H64 'Numpad Taste 4
    71. Private Const VK_NUMPAD5 = &H65 'Numpad Taste 5
    72. Private Const VK_NUMPAD6 = &H66 'Numpad Taste 6
    73. Private Const VK_NUMPAD7 = &H67 'Numpad Taste 7
    74. Private Const VK_NUMPAD8 = &H68 'Numpad Taste 8
    75. Private Const VK_NUMPAD9 = &H69 'Numpad Taste 9
    76. Private Const VK_MULTIPLY = &H6A 'Numpad Multiplikations Taste (*)
    77. Private Const VK_ADD = &H6B 'Numpad Additions Taste (+)
    78. Private Const VK_SUBTRACT = &H6D 'Numpad Subtrations Taste (-)
    79. Private Const VK_DECIMAL = &H6E 'Numpad Komma Taste (,)
    80. Private Const VK_DIVIDE = &H6F 'Numpad Devidierungs Taste (/)
    81. Private Const VK_F1 = &H70 'F1 Taste
    82. Private Const VK_F2 = &H71 'F2 Taste
    83. Private Const VK_F3 = &H72 'F3 Taste
    84. Private Const VK_F4 = &H73 'F4 Taste
    85. Private Const VK_F5 = &H74 'F5 Taste
    86. Private Const VK_F6 = &H75 'F6 Taste
    87. Private Const VK_F7 = &H76 'F7 Taste
    88. Private Const VK_F8 = &H77 'F8 Taste
    89. Private Const VK_F9 = &H78 'F9 Taste
    90. Private Const VK_F10 = &H79 'F10 Taste
    91. Private Const VK_F11 = &H7A 'F11 Taste
    92. Private Const VK_F12 = &H7B 'F12 Taste
    93. Private Const VK_NUMLOCK = &H90 'Numlock Taste
    94. Private Const VK_OEM_SCROLL = &H91 'Scroll Lock
    95. Private Const VK_LSHIFT = &HA0 'Linke Shift-Taste
    96. Private Const VK_RSHIFT = &HA1 'Rechte Shift-Taste
    97. Private Const VK_LCONTROL = &HA2 'Linke STRG-Taste
    98. Private Const VK_RCONTROL = &HA3 'Rechte STRG-Taste
    99. Private Const VK_LMENU = &HA4 'Linke ALT-Taste
    100. Private Const VK_RMENU = &HA5 'Rechte ALT-Taste
    101. Private Const VK_OEM_1 = &HBA '";"-Taste
    102. Private Const VK_OEM_PLUS = &HBB '"
    103. Private Const VK_OEM_COMMA = &HBC '","-Taste
    104. Private Const VK_OEM_MINUS = &HBD '"-"-Taste
    105. Private Const VK_OEM_PERIOD = &HBE '"."-taste
    106. Private Const VK_OEM_2 = &HBF '"/"-Taste
    107. Private Const VK_OEM_3 = &HC0 '"`"-Taste
    108. Private Const VK_OEM_4 = &HDB '"['-Taste
    109. Private Const VK_OEM_5 = &HDC ''\'-Taste
    110. Private Const VK_OEM_6 = &HDD '']"-Taste
    111. Private Const VK_LWIN = &H5B 'Linke Windows-Taste
    112. 'Variablen festlegung
    113. Dim vBack As Integer
    114. Dim vTab As Integer
    115. Dim vEnter As Integer
    116. Dim vShift As Integer
    117. Dim vStrg As Integer
    118. Dim vAlt As Integer
    119. Dim vPause As Integer
    120. Dim vFeststell As Integer
    121. Dim vEscape As Integer
    122. Dim vSpace As Integer
    123. Dim vPageUp As Integer
    124. Dim vPageDown As Integer
    125. Dim vEnde As Integer
    126. Dim vPos1 As Integer
    127. Dim vleft As Integer
    128. Dim vUp As Integer
    129. Dim vRight As Integer
    130. Dim vDown As Integer
    131. Dim vDrucken As Integer
    132. Dim vEinfuegen As Integer
    133. Dim vEntfernen As Integer
    134. Dim v0 As Integer
    135. Dim v1 As Integer
    136. Dim v2 As Integer
    137. Dim v3 As Integer
    138. Dim v4 As Integer
    139. Dim v5 As Integer
    140. Dim v6 As Integer
    141. Dim v7 As Integer
    142. Dim v8 As Integer
    143. Dim v9 As Integer
    144. Dim vA As Integer
    145. Dim vB As Integer
    146. Dim vC As Integer
    147. Dim vD As Integer
    148. Dim vE As Integer
    149. Dim vF As Integer
    150. Dim vG As Integer
    151. Dim vH As Integer
    152. Dim vI As Integer
    153. Dim vJ As Integer
    154. Dim vK As Integer
    155. Dim vL As Integer
    156. Dim vM As Integer
    157. Dim vN As Integer
    158. Dim vO As Integer
    159. Dim vP As Integer
    160. Dim vQ As Integer
    161. Dim vR As Integer
    162. Dim vS As Integer
    163. Dim vT As Integer
    164. Dim vU As Integer
    165. Dim vV As Integer
    166. Dim vW As Integer
    167. Dim vX As Integer
    168. Dim vY As Integer
    169. Dim vZ As Integer
    170. Dim vStartkey As Integer
    171. Dim vKontext As Integer
    172. Dim vNum0 As Integer
    173. Dim vNum1 As Integer
    174. Dim vNum2 As Integer
    175. Dim vNum3 As Integer
    176. Dim vNum4 As Integer
    177. Dim vNum5 As Integer
    178. Dim vNum6 As Integer
    179. Dim vNum7 As Integer
    180. Dim vNum8 As Integer
    181. Dim vNum9 As Integer
    182. Dim vNummal As Integer
    183. Dim vNumplus As Integer
    184. Dim vNumminus As Integer
    185. Dim vNumkomma As Integer
    186. Dim vNumteilen As Integer
    187. Dim vF1 As Integer
    188. Dim vF2 As Integer
    189. Dim vF3 As Integer
    190. Dim vF4 As Integer
    191. Dim vF5 As Integer
    192. Dim vF6 As Integer
    193. Dim vF7 As Integer
    194. Dim vF8 As Integer
    195. Dim vF9 As Integer
    196. Dim vF10 As Integer
    197. Dim vF11 As Integer
    198. Dim vF12 As Integer
    199. Dim vNumlock As Integer
    200. Dim vScrolllock As Integer
    201. Dim vLshift As Integer
    202. Dim vRshift As Integer
    203. Dim vLstrg As Integer
    204. Dim vRstrg As Integer
    205. Dim vLalt As Integer
    206. Dim vRalt As Integer
    207. Dim vsimikolon As Integer
    208. Dim vplus As Integer
    209. Dim vkomma As Integer
    210. Dim vMinus As Integer
    211. Dim vPunkt As Integer
    212. Dim vGeteil As Integer
    213. Dim vStich As Integer
    214. Dim vEklammera As Integer
    215. Dim vGeteilb As Integer
    216. Dim vEklammerb As Integer
    217. Dim vLwin As Integer
    218. 'Die Nächsten Variablen werden Festgelegt.....
    219. Dim vBacktext As String
    220. Dim vTabtext As String
    221. Dim vEntertext As String
    222. Dim vShifttext As String
    223. Dim vStrgtext As String
    224. Dim vAlttext As String
    225. Dim vPausetext As String
    226. Dim vFeststelltext As String
    227. Dim vEscapetext As String
    228. Dim vSpacetext As String
    229. Dim vPageUptext As String
    230. Dim vPageDowntext As String
    231. Dim vEndetext As String
    232. Dim vPos1text As String
    233. Dim vlefttext As String
    234. Dim vUptext As String
    235. Dim vRighttext As String
    236. Dim vDowntext As String
    237. Dim vDruckentext As String
    238. Dim vEinfuegentext As String
    239. Dim vEntfernentext As String
    240. Dim v0text As String
    241. Dim v1text As String
    242. Dim v2text As String
    243. Dim v3text As String
    244. Dim v4text As String
    245. Dim v5text As String
    246. Dim v6text As String
    247. Dim v7text As String
    248. Dim v8text As String
    249. Dim v9text As String
    250. Dim vAtext As String
    251. Dim vBtext As String
    252. Dim vCtext As String
    253. Dim vDtext As String
    254. Dim vEtext As String
    255. Dim vFtext As String
    256. Dim vGtext As String
    257. Dim vHtext As String
    258. Dim vItext As String
    259. Dim vJtext As String
    260. Dim vKtext As String
    261. Dim vLtext As String
    262. Dim vMtext As String
    263. Dim vNtext As String
    264. Dim vOtext As String
    265. Dim vPtext As String
    266. Dim vQtext As String
    267. Dim vRtext As String
    268. Dim vStext As String
    269. Dim vTtext As String
    270. Dim vUtext As String
    271. Dim vVtext As String
    272. Dim vWtext As String
    273. Dim vXtext As String
    274. Dim vYtext As String
    275. Dim vZtext As String
    276. Dim vStartkeytext As String
    277. Dim vKontexttext As String
    278. Dim vNum0text As String
    279. Dim vNum1text As String
    280. Dim vNum2text As String
    281. Dim vNum3text As String
    282. Dim vNum4text As String
    283. Dim vNum5text As String
    284. Dim vNum6text As String
    285. Dim vNum7text As String
    286. Dim vNum8text As String
    287. Dim vNum9text As String
    288. Dim vNummaltext As String
    289. Dim vNumplustext As String
    290. Dim vNumminustext As String
    291. Dim vNumkommatext As String
    292. Dim vNumteilentext As String
    293. Dim vF1text As String
    294. Dim vF2text As String
    295. Dim vF3text As String
    296. Dim vF4text As String
    297. Dim vF5text As String
    298. Dim vF6text As String
    299. Dim vF7text As String
    300. Dim vF8text As String
    301. Dim vF9text As String
    302. Dim vF10text As String
    303. Dim vF11text As String
    304. Dim vF12text As String
    305. Dim vNumlocktext As String
    306. Dim vScrolllocktext As String
    307. Dim vLshifttext As String
    308. Dim vRshifttext As String
    309. Dim vLstrgtext As String
    310. Dim vRstrgtext As String
    311. Dim vLalttext As String
    312. Dim vRalttext As String
    313. Dim vsimikolontext As String
    314. Dim vplustext As String
    315. Dim vkommatext As String
    316. Dim vMinustext As String
    317. Dim vPunkttext As String
    318. Dim vGeteiltext As String
    319. Dim vStichtext As String
    320. Dim vEklammeratext As String
    321. Dim vGeteilbtext As String
    322. Dim vEklammerbtext As String
    323. Dim vLwintext As String
    324. Private Sub Form_Load()
    325. ' Sicherheitsfestlegung auf "1"
    326. vBack = "1"
    327. vTab = "1"
    328. vEnter = "1"
    329. vShift = "1"
    330. vStrg = "1"
    331. vAlt = "1"
    332. vPause = "1"
    333. vFeststell = "1"
    334. vEscape = "1"
    335. vSpace = "1"
    336. vPageUp = "1"
    337. vPageDown = "1"
    338. vEnde = "1"
    339. vPos1 = "1"
    340. vleft = "1"
    341. vUp = "1"
    342. vRight = "1"
    343. vDown = "1"
    344. vDrucken = "1"
    345. vEinfuegen = "1"
    346. vEntfernen = "1"
    347. v0 = "1"
    348. v1 = "1"
    349. v2 = "1"
    350. v3 = "1"
    351. v4 = "1"
    352. v5 = "1"
    353. v6 = "1"
    354. v7 = "1"
    355. v8 = "1"
    356. v9 = "1"
    357. vA = "1"
    358. vB = "1"
    359. vC = "1"
    360. vD = "1"
    361. vE = "1"
    362. vF = "1"
    363. vG = "1"
    364. vH = "1"
    365. vI = "1"
    366. vJ = "1"
    367. vK = "1"
    368. vL = "1"
    369. vM = "1"
    370. vN = "1"
    371. vO = "1"
    372. vP = "1"
    373. vQ = "1"
    374. vR = "1"
    375. vS = "1"
    376. vT = "1"
    377. vU = "1"
    378. vV = "1"
    379. vW = "1"
    380. vX = "1"
    381. vY = "1"
    382. vZ = "1"
    383. vStartkey = "1"
    384. vKontext = "1"
    385. vNum0 = "1"
    386. vNum1 = "1"
    387. vNum2 = "1"
    388. vNum3 = "1"
    389. vNum4 = "1"
    390. vNum5 = "1"
    391. vNum6 = "1"
    392. vNum7 = "1"
    393. vNum8 = "1"
    394. vNum9 = "1"
    395. vNummal = "1"
    396. vNumplus = "1"
    397. vNumminus = "1"
    398. vNumkomma = "1"
    399. vNumteilen = "1"
    400. vF1 = "1"
    401. vF2 = "1"
    402. vF3 = "1"
    403. vF4 = "1"
    404. vF5 = "1"
    405. vF6 = "1"
    406. vF7 = "1"
    407. vF8 = "1"
    408. vF9 = "1"
    409. vF10 = "1"
    410. vF11 = "1"
    411. vF12 = "1"
    412. vNumlock = "1"
    413. vScrolllock = "1"
    414. vLshift = "1"
    415. vRshift = "1"
    416. vLstrg = "1"
    417. vRstrg = "1"
    418. vLalt = "1"
    419. vRalt = "1"
    420. vsimikolon = "1"
    421. vplus = "1"
    422. vkomma = "1"
    423. vMinus = "1"
    424. vPunkt = "1"
    425. vGeteil = "1"
    426. vStich = "1"
    427. vEklammera = "1"
    428. vGeteilb = "1"
    429. vEklammerb = "1"
    430. vLwin = "1"
    431. 'sichherheitsfestlegung auf "Up"
    432. vBacktext = "Up"
    433. vTabtext = "Up"
    434. vEntertext = "Up"
    435. vShifttext = "Up"
    436. vStrgtext = "Up"
    437. vAlttext = "Up"
    438. vPausetext = "Up"
    439. vFeststelltext = "Up"
    440. vEscapetext = "Up"
    441. vSpacetext = "Up"
    442. vPageUptext = "Up"
    443. vPageDowntext = "Up"
    444. vEndetext = "Up"
    445. vPos1text = "Up"
    446. vlefttext = "Up"
    447. vUptext = "Up"
    448. vRighttext = "Up"
    449. vDowntext = "Up"
    450. vDruckentext = "Up"
    451. vEinfuegentext = "Up"
    452. vEntfernentext = "Up"
    453. v0text = "Up"
    454. v1text = "Up"
    455. v2text = "Up"
    456. v3text = "Up"
    457. v4text = "Up"
    458. v5text = "Up"
    459. v6text = "Up"
    460. v7text = "Up"
    461. v8text = "Up"
    462. v9text = "Up"
    463. vAtext = "Up"
    464. vBtext = "Up"
    465. vCtext = "Up"
    466. vDtext = "Up"
    467. vEtext = "Up"
    468. vFtext = "Up"
    469. vGtext = "Up"
    470. vHtext = "Up"
    471. vItext = "Up"
    472. vJtext = "Up"
    473. vKtext = "Up"
    474. vLtext = "Up"
    475. vMtext = "Up"
    476. vNtext = "Up"
    477. vOtext = "Up"
    478. vPtext = "Up"
    479. vQtext = "Up"
    480. vRtext = "Up"
    481. vStext = "Up"
    482. vTtext = "Up"
    483. vUtext = "Up"
    484. vVtext = "Up"
    485. vWtext = "Up"
    486. vXtext = "Up"
    487. vYtext = "Up"
    488. vZtext = "Up"
    489. vStartkeytext = "Up"
    490. vKontexttext = "Up"
    491. vNum0text = "Up"
    492. vNum1text = "Up"
    493. vNum2text = "Up"
    494. vNum3text = "Up"
    495. vNum4text = "Up"
    496. vNum5text = "Up"
    497. vNum6text = "Up"
    498. vNum7text = "Up"
    499. vNum8text = "Up"
    500. vNum9text = "Up"
    501. vNummaltext = "Up"
    502. vNumplustext = "Up"
    503. vNumminustext = "Up"
    504. vNumkommatext = "Up"
    505. vNumteilentext = "Up"
    506. vF1text = "Up"
    507. vF2text = "Up"
    508. vF3text = "Up"
    509. vF4text = "Up"
    510. vF5text = "Up"
    511. vF6text = "Up"
    512. vF7text = "Up"
    513. vF8text = "Up"
    514. vF9text = "Up"
    515. vF10text = "Up"
    516. vF11text = "Up"
    517. vF12text = "Up"
    518. vNumlocktext = "Up"
    519. vScrolllocktext = "Up"
    520. vLshifttext = "Up"
    521. vRshifttext = "Up"
    522. vLstrgtext = "Up"
    523. vRstrgtext = "Up"
    524. vLalttext = "Up"
    525. vRalttext = "Up"
    526. vsimikolontext = "Up"
    527. vplustext = "Up"
    528. vkommatext = "Up"
    529. vMinustext = "Up"
    530. vPunkttext = "Up"
    531. vGeteiltext = "Up"
    532. vStichtext = "Up"
    533. vEklammeratext = "Up"
    534. vGeteilbtext = "Up"
    535. vEklammerbtext = "Up"
    536. vLwintext = "Up"
    537. End Sub
    538. Private Sub Timer1_Timer()
    539. 'Beispiele Der Variablen Festlegung, nicht zwingend !!!
    540. vLwintext = Text1.Text
    541. vMinustext = Text2.Text
    542. 'und so weiter immer als erstes die Variable (z.B. vDowntext) und dann die auszulesende TextBox(z.B. text3.text) !!
    543. Tastendruck
    544. End Sub
    545. Private Sub Tastendruck()
    546. ' Die Tastendruck simulation !!! Nicht SendKeys !!
    547. 'vBack
    548. If vBack = "1" And vBacktext = "Down" Then
    549. Call keybd_event(VK_BACK, 0&, 0&, 0&)
    550. vBack = "2"
    551. End If
    552. If vBack = "2" And vBacktext = "Up" Then
    553. Call keybd_event(VK_BACK, 0&, KEYEVENTF_KEYUP, 0&)
    554. vBack = "1"
    555. End If
    556. 'vTab
    557. If vTab = "1" And vTabtext = "Down" Then
    558. Call keybd_event(VK_TAB, 0&, 0&, 0&)
    559. vTab = "2"
    560. End If
    561. If vTab = "2" And vTabtext = "Up" Then
    562. Call keybd_event(VK_TAB, 0&, KEYEVENTF_KEYUP, 0&)
    563. vTab = "1"
    564. End If
    565. 'vEnter
    566. If vEnter = "1" And vEntertext = "Down" Then
    567. Call keybd_event(VK_RETURN, 0&, 0&, 0&)
    568. vEnter = "2"
    569. End If
    570. If vEnter = "2" And vEntertext = "Up" Then
    571. Call keybd_event(VK_RETURN, 0&, KEYEVENTF_KEYUP, 0&)
    572. vEnter = "1"
    573. End If
    574. 'vShift
    575. If vShift = "1" And vShifttext = "Down" Then
    576. Call keybd_event(VK_SHIFT, 0&, 0&, 0&)
    577. vShift = "2"
    578. End If
    579. If vShift = "2" And vShifttext = "Up" Then
    580. Call keybd_event(VK_SHIFT, 0&, KEYEVENTF_KEYUP, 0&)
    581. vShift = "1"
    582. End If
    583. 'vStrg
    584. If vStrg = "1" And vStrgtext = "Down" Then
    585. Call keybd_event(VK_CONTROL, 0&, 0&, 0&)
    586. vStrg = "2"
    587. End If
    588. If vStrg = "2" And vStrgtext = "Up" Then
    589. Call keybd_event(VK_CONTROL, 0&, KEYEVENTF_KEYUP, 0&)
    590. vStrg = "1"
    591. End If
    592. 'vAlt
    593. If vAlt = "1" And vAlttext = "Down" Then
    594. Call keybd_event(VK_MENU, 0&, 0&, 0&)
    595. vAlt = "2"
    596. End If
    597. If vAlt = "2" And vAlttext = "Up" Then
    598. Call keybd_event(VK_MENU, 0&, KEYEVENTF_KEYUP, 0&)
    599. vAlt = "1"
    600. End If
    601. 'vPause
    602. If vPause = "1" And vPausetext = "Down" Then
    603. Call keybd_event(VK_PAUSE, 0&, 0&, 0&)
    604. vPause = "2"
    605. End If
    606. If vPause = "2" And vPausetext = "Up" Then
    607. Call keybd_event(VK_PAUSE, 0&, KEYEVENTF_KEYUP, 0&)
    608. vPause = "1"
    609. End If
    610. 'vFeststell
    611. If vFeststell = "1" And vFeststelltext = "Down" Then
    612. Call keybd_event(VK_CAPITAL, 0&, 0&, 0&)
    613. vFeststell = "2"
    614. End If
    615. If vFeststell = "2" And vFeststelltext = "Up" Then
    616. Call keybd_event(VK_CAPITAL, 0&, KEYEVENTF_KEYUP, 0&)
    617. vFeststell = "1"
    618. End If
    619. 'vEscape
    620. If vEscape = "1" And vEscapetext = "Down" Then
    621. Call keybd_event(VK_ESCAPE, 0&, 0&, 0&)
    622. vEscape = "2"
    623. End If
    624. If vEscape = "2" And vEscapetext = "Up" Then
    625. Call keybd_event(VK_ESCAPE, 0&, KEYEVENTF_KEYUP, 0&)
    626. vEscape = "1"
    627. End If
    628. 'vSpace
    629. If vSpace = "1" And vSpacetext = "Down" Then
    630. Call keybd_event(VK_SPACE, 0&, 0&, 0&)
    631. vSpace = "2"
    632. End If
    633. If vSpace = "2" And vSpacetext = "Up" Then
    634. Call keybd_event(VK_SPACE, 0&, KEYEVENTF_KEYUP, 0&)
    635. vSpace = "1"
    636. End If
    637. 'vPageUp
    638. If vPageUp = "1" And vPageUptext = "Down" Then
    639. Call keybd_event(VK_PRIOR, 0&, 0&, 0&)
    640. vPageUp = "2"
    641. End If
    642. If vPageUp = "2" And vPageUptext = "Up" Then
    643. Call keybd_event(VK_PRIOR, 0&, KEYEVENTF_KEYUP, 0&)
    644. vPageUp = "1"
    645. End If
    646. 'vPageDown
    647. If vPageDown = "1" And vPageDowntext = "Down" Then
    648. Call keybd_event(VK_NEXT, 0&, 0&, 0&)
    649. vPageDown = "2"
    650. End If
    651. If vPageDown = "2" And vPageDowntext = "Up" Then
    652. Call keybd_event(VK_NEXT, 0&, KEYEVENTF_KEYUP, 0&)
    653. vPageDown = "1"
    654. End If
    655. 'vEnde
    656. If vEnde = "1" And vEndetext = "Down" Then
    657. Call keybd_event(VK_END, 0&, 0&, 0&)
    658. vEnde = "2"
    659. End If
    660. If vEnde = "2" And vEndetext = "Up" Then
    661. Call keybd_event(VK_END, 0&, KEYEVENTF_KEYUP, 0&)
    662. vEnde = "1"
    663. End If
    664. 'vPos1
    665. If vPos1 = "1" And vPos1text = "Down" Then
    666. Call keybd_event(VK_HOME, 0&, 0&, 0&)
    667. vPos1 = "2"
    668. End If
    669. If vPos1 = "2" And vPos1text = "Up" Then
    670. Call keybd_event(VK_HOME, 0&, KEYEVENTF_KEYUP, 0&)
    671. vPos1 = "1"
    672. End If
    673. 'vleft
    674. If vleft = "1" And vlefttext = "Down" Then
    675. Call keybd_event(VK_LEFT, 0&, 0&, 0&)
    676. vleft = "2"
    677. End If
    678. If vleft = "2" And vlefttext = "Up" Then
    679. Call keybd_event(VK_LEFT, 0&, KEYEVENTF_KEYUP, 0&)
    680. vleft = "1"
    681. End If
    682. 'vUp
    683. If vUp = "1" And vUptext = "Down" Then
    684. Call keybd_event(VK_UP, 0&, 0&, 0&)
    685. vUp = "2"
    686. End If
    687. If vUp = "2" And vUptext = "Up" Then
    688. Call keybd_event(VK_UP, 0&, KEYEVENTF_KEYUP, 0&)
    689. vUp = "1"
    690. End If
    691. 'vRight
    692. If vRight = "1" And vRighttext = "Down" Then
    693. Call keybd_event(VK_RIGHT, 0&, 0&, 0&)
    694. vRight = "2"
    695. End If
    696. If vRight = "2" And vRighttext = "Up" Then
    697. Call keybd_event(VK_RIGHT, 0&, KEYEVENTF_KEYUP, 0&)
    698. vRight = "1"
    699. End If
    700. 'vDown
    701. If vDown = "1" And vDowntext = "Down" Then
    702. Call keybd_event(VK_DOWN, 0&, 0&, 0&)
    703. vDown = "2"
    704. End If
    705. If vDown = "2" And vDowntext = "Up" Then
    706. Call keybd_event(VK_DOWN, 0&, KEYEVENTF_KEYUP, 0&)
    707. vDown = "1"
    708. End If
    709. 'vDrucken
    710. If vDrucken = "1" And vDruckentext = "Down" Then
    711. Call keybd_event(VK_SNAPSHOT, 0&, 0&, 0&)
    712. vDrucken = "2"
    713. End If
    714. If vDrucken = "2" And vDruckentext = "Up" Then
    715. Call keybd_event(VK_SNAPSHOT, 0&, KEYEVENTF_KEYUP, 0&)
    716. vDrucken = "1"
    717. End If
    718. 'vEinfuegen
    719. If vEinfuegen = "1" And vEinfuegentext = "Down" Then
    720. Call keybd_event(VK_INSERT, 0&, 0&, 0&)
    721. vEinfuegen = "2"
    722. End If
    723. If vEinfuegen = "2" And vEinfuegentext = "Up" Then
    724. Call keybd_event(VK_INSERT, 0&, KEYEVENTF_KEYUP, 0&)
    725. vEinfuegen = "1"
    726. End If
    727. 'vEntfernen
    728. If vEntfernen = "1" And vEntfernentext = "Down" Then
    729. Call keybd_event(VK_DELETE, 0&, 0&, 0&)
    730. vEntfernen = "2"
    731. End If
    732. If vEntfernen = "2" And vEntfernentext = "Up" Then
    733. Call keybd_event(VK_DELETE, 0&, KEYEVENTF_KEYUP, 0&)
    734. vEntfernen = "1"
    735. End If
    736. 'v0
    737. If v0 = "1" And v0text = "Down" Then
    738. Call keybd_event(VK_0, 0&, 0&, 0&)
    739. v0 = "2"
    740. End If
    741. If v0 = "2" And v0text = "Up" Then
    742. Call keybd_event(VK_0, 0&, KEYEVENTF_KEYUP, 0&)
    743. v0 = "1"
    744. End If
    745. 'v1
    746. If v1 = "1" And v1text = "Down" Then
    747. Call keybd_event(VK_1, 0&, 0&, 0&)
    748. v1 = "2"
    749. End If
    750. If v1 = "2" And v1text = "Up" Then
    751. Call keybd_event(VK_1, 0&, KEYEVENTF_KEYUP, 0&)
    752. v1 = "1"
    753. End If
    754. 'v2
    755. If v2 = "1" And v2text = "Down" Then
    756. Call keybd_event(VK_2, 0&, 0&, 0&)
    757. v2 = "2"
    758. End If
    759. If v2 = "2" And v2text = "Up" Then
    760. Call keybd_event(VK_2, 0&, KEYEVENTF_KEYUP, 0&)
    761. v2 = "1"
    762. End If
    763. 'v3
    764. If v3 = "1" And v3text = "Down" Then
    765. Call keybd_event(VK_3, 0&, 0&, 0&)
    766. v3 = "2"
    767. End If
    768. If v3 = "2" And v3text = "Up" Then
    769. Call keybd_event(VK_3, 0&, KEYEVENTF_KEYUP, 0&)
    770. v3 = "1"
    771. End If
    772. 'v4
    773. If v4 = "1" And v4text = "Down" Then
    774. Call keybd_event(VK_4, 0&, 0&, 0&)
    775. v4 = "2"
    776. End If
    777. If v4 = "2" And v4text = "Up" Then
    778. Call keybd_event(VK_4, 0&, KEYEVENTF_KEYUP, 0&)
    779. v4 = "1"
    780. End If
    781. 'v5
    782. If v5 = "1" And v5text = "Down" Then
    783. Call keybd_event(VK_5, 0&, 0&, 0&)
    784. v5 = "2"
    785. End If
    786. If v5 = "2" And v5text = "Up" Then
    787. Call keybd_event(VK_5, 0&, KEYEVENTF_KEYUP, 0&)
    788. v5 = "1"
    789. End If
    790. 'v6
    791. If v6 = "1" And v6text = "Down" Then
    792. Call keybd_event(VK_6, 0&, 0&, 0&)
    793. v6 = "2"
    794. End If
    795. If v6 = "2" And v6text = "Up" Then
    796. Call keybd_event(VK_6, 0&, KEYEVENTF_KEYUP, 0&)
    797. v6 = "1"
    798. End If
    799. 'v7
    800. If v7 = "1" And v7text = "Down" Then
    801. Call keybd_event(VK_7, 0&, 0&, 0&)
    802. v7 = "2"
    803. End If
    804. If v7 = "2" And v7text = "Up" Then
    805. Call keybd_event(VK_7, 0&, KEYEVENTF_KEYUP, 0&)
    806. v7 = "1"
    807. End If
    808. 'v8
    809. If v8 = "1" And v8text = "Down" Then
    810. Call keybd_event(VK_8, 0&, 0&, 0&)
    811. v8 = "2"
    812. End If
    813. If v8 = "2" And v8text = "Up" Then
    814. Call keybd_event(VK_8, 0&, KEYEVENTF_KEYUP, 0&)
    815. v8 = "1"
    816. End If
    817. 'v9
    818. If v9 = "1" And v9text = "Down" Then
    819. Call keybd_event(VK_9, 0&, 0&, 0&)
    820. v9 = "2"
    821. End If
    822. If v9 = "2" And v9text = "Up" Then
    823. Call keybd_event(VK_9, 0&, KEYEVENTF_KEYUP, 0&)
    824. v9 = "1"
    825. End If
    826. 'vA
    827. If vA = "1" And vAtext = "Down" Then
    828. Call keybd_event(VK_A, 0&, 0&, 0&)
    829. vA = "2"
    830. End If
    831. If vA = "2" And vAtext = "Up" Then
    832. Call keybd_event(VK_A, 0&, KEYEVENTF_KEYUP, 0&)
    833. vA = "1"
    834. End If
    835. 'vB
    836. If vB = "1" And vBtext = "Down" Then
    837. Call keybd_event(VK_B, 0&, 0&, 0&)
    838. vB = "2"
    839. End If
    840. If vB = "2" And vBtext = "Up" Then
    841. Call keybd_event(VK_B, 0&, KEYEVENTF_KEYUP, 0&)
    842. vB = "1"
    843. End If
    844. 'vC
    845. If vC = "1" And vCtext = "Down" Then
    846. Call keybd_event(VK_C, 0&, 0&, 0&)
    847. vC = "2"
    848. End If
    849. If vC = "2" And vCtext = "Up" Then
    850. Call keybd_event(VK_C, 0&, KEYEVENTF_KEYUP, 0&)
    851. vC = "1"
    852. End If
    853. 'vD
    854. If vD = "1" And vDtext = "Down" Then
    855. Call keybd_event(VK_D, 0&, 0&, 0&)
    856. vD = "2"
    857. End If
    858. If vD = "2" And vDtext = "Up" Then
    859. Call keybd_event(VK_D, 0&, KEYEVENTF_KEYUP, 0&)
    860. vD = "1"
    861. End If
    862. 'vE
    863. If vE = "1" And vEtext = "Down" Then
    864. Call keybd_event(VK_E, 0&, 0&, 0&)
    865. vE = "2"
    866. End If
    867. If vE = "2" And vEtext = "Up" Then
    868. Call keybd_event(VK_E, 0&, KEYEVENTF_KEYUP, 0&)
    869. vE = "1"
    870. End If
    871. 'vF
    872. If vF = "1" And vFtext = "Down" Then
    873. Call keybd_event(VK_F, 0&, 0&, 0&)
    874. vF = "2"
    875. End If
    876. If vF = "2" And vFtext = "Up" Then
    877. Call keybd_event(VK_F, 0&, KEYEVENTF_KEYUP, 0&)
    878. vF = "1"
    879. End If
    880. 'vG
    881. If vG = "1" And vGtext = "Down" Then
    882. Call keybd_event(VK_G, 0&, 0&, 0&)
    883. vG = "2"
    884. End If
    885. If vG = "2" And vGtext = "Up" Then
    886. Call keybd_event(VK_G, 0&, KEYEVENTF_KEYUP, 0&)
    887. vG = "1"
    888. End If
    889. 'vH
    890. If vH = "1" And vHtext = "Down" Then
    891. Call keybd_event(VK_H, 0&, 0&, 0&)
    892. vH = "2"
    893. End If
    894. If vH = "2" And vHtext = "Up" Then
    895. Call keybd_event(VK_H, 0&, KEYEVENTF_KEYUP, 0&)
    896. vH = "1"
    897. End If
    898. 'vI
    899. If vI = "1" And vItext = "Down" Then
    900. Call keybd_event(VK_I, 0&, 0&, 0&)
    901. vI = "2"
    902. End If
    903. If vI = "2" And vItext = "Up" Then
    904. Call keybd_event(VK_I, 0&, KEYEVENTF_KEYUP, 0&)
    905. vI = "1"
    906. End If
    907. 'vJ
    908. If vJ = "1" And vJtext = "Down" Then
    909. Call keybd_event(VK_J, 0&, 0&, 0&)
    910. vJ = "2"
    911. End If
    912. If vJ = "2" And vJtext = "Up" Then
    913. Call keybd_event(VK_J, 0&, KEYEVENTF_KEYUP, 0&)
    914. vJ = "1"
    915. End If
    916. 'vK
    917. If vK = "1" And vKtext = "Down" Then
    918. Call keybd_event(VK_K, 0&, 0&, 0&)
    919. vK = "2"
    920. End If
    921. If vK = "2" And vKtext = "Up" Then
    922. Call keybd_event(VK_K, 0&, KEYEVENTF_KEYUP, 0&)
    923. vK = "1"
    924. End If
    925. 'vL
    926. If vL = "1" And vLtext = "Down" Then
    927. Call keybd_event(VK_L, 0&, 0&, 0&)
    928. vL = "2"
    929. End If
    930. If vL = "2" And vLtext = "Up" Then
    931. Call keybd_event(VK_L, 0&, KEYEVENTF_KEYUP, 0&)
    932. vL = "1"
    933. End If
    934. 'vM
    935. If vM = "1" And vMtext = "Down" Then
    936. Call keybd_event(VK_M, 0&, 0&, 0&)
    937. vM = "2"
    938. End If
    939. If vM = "2" And vMtext = "Up" Then
    940. Call keybd_event(VK_M, 0&, KEYEVENTF_KEYUP, 0&)
    941. vM = "1"
    942. End If
    943. 'vN
    944. If vN = "1" And vNtext = "Down" Then
    945. Call keybd_event(VK_N, 0&, 0&, 0&)
    946. vN = "2"
    947. End If
    948. If vN = "2" And vNtext = "Up" Then
    949. Call keybd_event(VK_N, 0&, KEYEVENTF_KEYUP, 0&)
    950. vN = "1"
    951. End If
    952. 'vO
    953. If vO = "1" And vOtext = "Down" Then
    954. Call keybd_event(VK_O, 0&, 0&, 0&)
    955. vO = "2"
    956. End If
    957. If vO = "2" And vOtext = "Up" Then
    958. Call keybd_event(VK_O, 0&, KEYEVENTF_KEYUP, 0&)
    959. vO = "1"
    960. End If
    961. 'vP
    962. If vP = "1" And vPtext = "Down" Then
    963. Call keybd_event(VK_P, 0&, 0&, 0&)
    964. vP = "2"
    965. End If
    966. If vP = "2" And vPtext = "Up" Then
    967. Call keybd_event(VK_P, 0&, KEYEVENTF_KEYUP, 0&)
    968. vP = "1"
    969. End If
    970. 'vQ
    971. If vQ = "1" And vQtext = "Down" Then
    972. Call keybd_event(VK_Q, 0&, 0&, 0&)
    973. vQ = "2"
    974. End If
    975. If vQ = "2" And vQtext = "Up" Then
    976. Call keybd_event(VK_Q, 0&, KEYEVENTF_KEYUP, 0&)
    977. vQ = "1"
    978. End If
    979. 'vR
    980. If vR = "1" And vRtext = "Down" Then
    981. Call keybd_event(VK_R, 0&, 0&, 0&)
    982. vR = "2"
    983. End If
    984. If vR = "2" And vRtext = "Up" Then
    985. Call keybd_event(VK_R, 0&, KEYEVENTF_KEYUP, 0&)
    986. vR = "1"
    987. End If
    988. 'vS
    989. If vS = "1" And vStext = "Down" Then
    990. Call keybd_event(VK_S, 0&, 0&, 0&)
    991. vS = "2"
    992. End If
    993. If vS = "2" And vStext = "Up" Then
    994. Call keybd_event(VK_S, 0&, KEYEVENTF_KEYUP, 0&)
    995. vS = "1"
    996. End If
    997. 'vT
    998. If vT = "1" And vTtext = "Down" Then
    999. Call keybd_event(VK_T, 0&, 0&, 0&)
    1000. vT = "2"
    1001. End If
    1002. If vT = "2" And vTtext = "Up" Then
    1003. Call keybd_event(VK_T, 0&, KEYEVENTF_KEYUP, 0&)
    1004. vT = "1"
    1005. End If
    1006. 'vU
    1007. If vU = "1" And vUtext = "Down" Then
    1008. Call keybd_event(VK_U, 0&, 0&, 0&)
    1009. vU = "2"
    1010. End If
    1011. If vU = "2" And vUtext = "Up" Then
    1012. Call keybd_event(VK_U, 0&, KEYEVENTF_KEYUP, 0&)
    1013. vU = "1"
    1014. End If
    1015. 'vV
    1016. If vV = "1" And vVtext = "Down" Then
    1017. Call keybd_event(VK_V, 0&, 0&, 0&)
    1018. vV = "2"
    1019. End If
    1020. If vV = "2" And vVtext = "Up" Then
    1021. Call keybd_event(VK_V, 0&, KEYEVENTF_KEYUP, 0&)
    1022. vV = "1"
    1023. End If
    1024. 'vW
    1025. If vW = "1" And vWtext = "Down" Then
    1026. Call keybd_event(VK_W, 0&, 0&, 0&)
    1027. vW = "2"
    1028. End If
    1029. If vW = "2" And vWtext = "Up" Then
    1030. Call keybd_event(VK_W, 0&, KEYEVENTF_KEYUP, 0&)
    1031. vW = "1"
    1032. End If
    1033. 'vX
    1034. If vX = "1" And vXtext = "Down" Then
    1035. Call keybd_event(VK_X, 0&, 0&, 0&)
    1036. vX = "2"
    1037. End If
    1038. If vX = "2" And vXtext = "Up" Then
    1039. Call keybd_event(VK_X, 0&, KEYEVENTF_KEYUP, 0&)
    1040. vX = "1"
    1041. End If
    1042. 'vX
    1043. If vX = "1" And vXtext = "Down" Then
    1044. Call keybd_event(VK_X, 0&, 0&, 0&)
    1045. vX = "2"
    1046. End If
    1047. If vX = "2" And vXtext = "Up" Then
    1048. Call keybd_event(VK_X, 0&, KEYEVENTF_KEYUP, 0&)
    1049. vX = "1"
    1050. End If
    1051. 'vY
    1052. If vY = "1" And vYtext = "Down" Then
    1053. Call keybd_event(VK_Y, 0&, 0&, 0&)
    1054. vY = "2"
    1055. End If
    1056. If vY = "2" And vYtext = "Up" Then
    1057. Call keybd_event(VK_Y, 0&, KEYEVENTF_KEYUP, 0&)
    1058. vY = "1"
    1059. End If
    1060. 'vZ
    1061. If vZ = "1" And vZtext = "Down" Then
    1062. Call keybd_event(VK_Z, 0&, 0&, 0&)
    1063. vZ = "2"
    1064. End If
    1065. If vZ = "2" And vZtext = "Up" Then
    1066. Call keybd_event(VK_Z, 0&, KEYEVENTF_KEYUP, 0&)
    1067. vZ = "1"
    1068. End If
    1069. 'vStartkey
    1070. If vStartkey = "1" And vStartkeytext = "Down" Then
    1071. Call keybd_event(VK_STARTKEY, 0&, 0&, 0&)
    1072. vStartkey = "2"
    1073. End If
    1074. If vStartkey = "2" And vStartkeytext = "Up" Then
    1075. Call keybd_event(VK_STARTKEY, 0&, KEYEVENTF_KEYUP, 0&)
    1076. vStartkey = "1"
    1077. End If
    1078. 'vKontext
    1079. If vKontext = "1" And vKontexttext = "Down" Then
    1080. Call keybd_event(VK_CONTEXTKEY, 0&, 0&, 0&)
    1081. vKontext = "2"
    1082. End If
    1083. If vKontext = "2" And vKontexttext = "Up" Then
    1084. Call keybd_event(VK_CONTEXTKEY, 0&, KEYEVENTF_KEYUP, 0&)
    1085. vKontext = "1"
    1086. End If
    1087. 'vNum0
    1088. If vNum0 = "1" And vNum0text = "Down" Then
    1089. Call keybd_event(VK_NUMPAD0, 0&, 0&, 0&)
    1090. vNum0 = "2"
    1091. End If
    1092. If vNum0 = "2" And vNum0text = "Up" Then
    1093. Call keybd_event(VK_NUMPAD0, 0&, KEYEVENTF_KEYUP, 0&)
    1094. vNum0 = "1"
    1095. End If
    1096. 'vNum1
    1097. If vNum1 = "1" And vNum1text = "Down" Then
    1098. Call keybd_event(VK_NUMPAD1, 0&, 0&, 0&)
    1099. vNum1 = "2"
    1100. End If
    1101. If vNum1 = "2" And vNum1text = "Up" Then
    1102. Call keybd_event(VK_NUMPAD1, 0&, KEYEVENTF_KEYUP, 0&)
    1103. vNum1 = "1"
    1104. End If
    1105. 'vNum2
    1106. If vNum2 = "1" And vNum2text = "Down" Then
    1107. Call keybd_event(VK_NUMPAD2, 0&, 0&, 0&)
    1108. vNum2 = "2"
    1109. End If
    1110. If vNum2 = "2" And vNum2text = "Up" Then
    1111. Call keybd_event(VK_NUMPAD2, 0&, KEYEVENTF_KEYUP, 0&)
    1112. vNum2 = "1"
    1113. End If
    1114. 'vNum3
    1115. If vNum3 = "1" And vNum3text = "Down" Then
    1116. Call keybd_event(VK_NUMPAD3, 0&, 0&, 0&)
    1117. vNum3 = "2"
    1118. End If
    1119. If vNum3 = "2" And vNum3text = "Up" Then
    1120. Call keybd_event(VK_NUMPAD3, 0&, KEYEVENTF_KEYUP, 0&)
    1121. vNum3 = "1"
    1122. End If
    1123. 'vNum4
    1124. If vNum4 = "1" And vNum4text = "Down" Then
    1125. Call keybd_event(VK_NUMPAD4, 0&, 0&, 0&)
    1126. vNum4 = "2"
    1127. End If
    1128. If vNum4 = "2" And vNum4text = "Up" Then
    1129. Call keybd_event(VK_NUMPAD4, 0&, KEYEVENTF_KEYUP, 0&)
    1130. vNum4 = "1"
    1131. End If
    1132. 'vNum5
    1133. If vNum5 = "1" And vNum5text = "Down" Then
    1134. Call keybd_event(VK_NUMPAD5, 0&, 0&, 0&)
    1135. vNum5 = "2"
    1136. End If
    1137. If vNum5 = "2" And vNum5text = "Up" Then
    1138. Call keybd_event(VK_NUMPAD5, 0&, KEYEVENTF_KEYUP, 0&)
    1139. vNum5 = "1"
    1140. End If
    1141. 'vNum6
    1142. If vNum6 = "1" And vNum6text = "Down" Then
    1143. Call keybd_event(VK_NUMPAD6, 0&, 0&, 0&)
    1144. vNum6 = "2"
    1145. End If
    1146. If vNum6 = "2" And vNum6text = "Up" Then
    1147. Call keybd_event(VK_NUMPAD6, 0&, KEYEVENTF_KEYUP, 0&)
    1148. vNum6 = "1"
    1149. End If
    1150. 'vNum7
    1151. If vNum7 = "1" And vNum7text = "Down" Then
    1152. Call keybd_event(VK_NUMPAD7, 0&, 0&, 0&)
    1153. vNum7 = "2"
    1154. End If
    1155. If vNum7 = "2" And vNum7text = "Up" Then
    1156. Call keybd_event(VK_NUMPAD7, 0&, KEYEVENTF_KEYUP, 0&)
    1157. vNum7 = "1"
    1158. End If
    1159. 'vNum8
    1160. If vNum8 = "1" And vNum8text = "Down" Then
    1161. Call keybd_event(VK_NUMPAD8, 0&, 0&, 0&)
    1162. vNum8 = "2"
    1163. End If
    1164. If vNum8 = "2" And vNum8text = "Up" Then
    1165. Call keybd_event(VK_NUMPAD8, 0&, KEYEVENTF_KEYUP, 0&)
    1166. vNum8 = "1"
    1167. End If
    1168. 'vNum9
    1169. If vNum9 = "1" And vNum9text = "Down" Then
    1170. Call keybd_event(VK_NUMPAD9, 0&, 0&, 0&)
    1171. vNum9 = "2"
    1172. End If
    1173. If vNum9 = "2" And vNum9text = "Up" Then
    1174. Call keybd_event(VK_NUMPAD9, 0&, KEYEVENTF_KEYUP, 0&)
    1175. vNum9 = "1"
    1176. End If
    1177. 'vNummal
    1178. If vNummal = "1" And vNummaltext = "Down" Then
    1179. Call keybd_event(VK_MULTIPLY, 0&, 0&, 0&)
    1180. vNummal = "2"
    1181. End If
    1182. If vNummal = "2" And vNummaltext = "Up" Then
    1183. Call keybd_event(VK_MULTIPLY, 0&, KEYEVENTF_KEYUP, 0&)
    1184. vNummal = "1"
    1185. End If
    1186. 'vNumplus
    1187. If vNumplus = "1" And vNumplustext = "Down" Then
    1188. Call keybd_event(VK_ADD, 0&, 0&, 0&)
    1189. vNumplus = "2"
    1190. End If
    1191. If vNumplus = "2" And vNumplustext = "Up" Then
    1192. Call keybd_event(VK_ADD, 0&, KEYEVENTF_KEYUP, 0&)
    1193. vNumplus = "1"
    1194. End If
    1195. 'vNumminus
    1196. If vNumminus = "1" And vNumminustext = "Down" Then
    1197. Call keybd_event(VK_SUBTRACT, 0&, 0&, 0&)
    1198. vNumminus = "2"
    1199. End If
    1200. If vNumminus = "2" And vNumminustext = "Up" Then
    1201. Call keybd_event(VK_SUBTRACT, 0&, KEYEVENTF_KEYUP, 0&)
    1202. vNumminus = "1"
    1203. End If
    1204. 'vNumkomma
    1205. If vNumkomma = "1" And vNumkommatext = "Down" Then
    1206. Call keybd_event(VK_DECIMAL, 0&, 0&, 0&)
    1207. vNumkomma = "2"
    1208. End If
    1209. If vNumkomma = "2" And vNumkommatext = "Up" Then
    1210. Call keybd_event(VK_DECIMAL, 0&, KEYEVENTF_KEYUP, 0&)
    1211. vNumkomma = "1"
    1212. End If
    1213. 'vNumteilen
    1214. If vNumteilen = "1" And vNumteilentext = "Down" Then
    1215. Call keybd_event(VK_DIVIDE, 0&, 0&, 0&)
    1216. vNumteilen = "2"
    1217. End If
    1218. If vNumteilen = "2" And vNumteilentext = "Up" Then
    1219. Call keybd_event(VK_DIVIDE, 0&, KEYEVENTF_KEYUP, 0&)
    1220. vNumteilen = "1"
    1221. End If
    1222. 'vF1
    1223. If vF1 = "1" And vF1text = "Down" Then
    1224. Call keybd_event(VK_F1, 0&, 0&, 0&)
    1225. vF1 = "2"
    1226. End If
    1227. If vF1 = "2" And vF1text = "Up" Then
    1228. Call keybd_event(VK_F1, 0&, KEYEVENTF_KEYUP, 0&)
    1229. vF1 = "1"
    1230. End If
    1231. 'vF2
    1232. If vF2 = "1" And vF2text = "Down" Then
    1233. Call keybd_event(VK_F2, 0&, 0&, 0&)
    1234. vF2 = "2"
    1235. End If
    1236. If vF2 = "2" And vF2text = "Up" Then
    1237. Call keybd_event(VK_F2, 0&, KEYEVENTF_KEYUP, 0&)
    1238. vF2 = "1"
    1239. End If
    1240. 'vF3
    1241. If vF3 = "1" And vF3text = "Down" Then
    1242. Call keybd_event(VK_F3, 0&, 0&, 0&)
    1243. vF3 = "2"
    1244. End If
    1245. If vF3 = "2" And vF3text = "Up" Then
    1246. Call keybd_event(VK_F3, 0&, KEYEVENTF_KEYUP, 0&)
    1247. vF3 = "1"
    1248. End If
    1249. 'vF4
    1250. If vF4 = "1" And vF4text = "Down" Then
    1251. Call keybd_event(VK_F4, 0&, 0&, 0&)
    1252. vF4 = "2"
    1253. End If
    1254. If vF4 = "2" And vF4text = "Up" Then
    1255. Call keybd_event(VK_F4, 0&, KEYEVENTF_KEYUP, 0&)
    1256. vF4 = "1"
    1257. End If
    1258. 'vF5
    1259. If vF5 = "1" And vF5text = "Down" Then
    1260. Call keybd_event(VK_F5, 0&, 0&, 0&)
    1261. vF5 = "2"
    1262. End If
    1263. If vF5 = "2" And vF5text = "Up" Then
    1264. Call keybd_event(VK_F5, 0&, KEYEVENTF_KEYUP, 0&)
    1265. vF5 = "1"
    1266. End If
    1267. 'vF6
    1268. If vF6 = "1" And vF6text = "Down" Then
    1269. Call keybd_event(VK_F6, 0&, 0&, 0&)
    1270. vF6 = "2"
    1271. End If
    1272. If vF6 = "2" And vF6text = "Up" Then
    1273. Call keybd_event(VK_F6, 0&, KEYEVENTF_KEYUP, 0&)
    1274. vF6 = "1"
    1275. End If
    1276. 'vF7
    1277. If vF7 = "1" And vF7text = "Down" Then
    1278. Call keybd_event(VK_F7, 0&, 0&, 0&)
    1279. vF7 = "2"
    1280. End If
    1281. If vF7 = "2" And vF7text = "Up" Then
    1282. Call keybd_event(VK_F7, 0&, KEYEVENTF_KEYUP, 0&)
    1283. vF7 = "1"
    1284. End If
    1285. 'vF8
    1286. If vF8 = "1" And vF8text = "Down" Then
    1287. Call keybd_event(VK_F8, 0&, 0&, 0&)
    1288. vF8 = "2"
    1289. End If
    1290. If vF8 = "2" And vF8text = "Up" Then
    1291. Call keybd_event(VK_F8, 0&, KEYEVENTF_KEYUP, 0&)
    1292. vF8 = "1"
    1293. End If
    1294. 'vF9
    1295. If vF9 = "1" And vF9text = "Down" Then
    1296. Call keybd_event(VK_F9, 0&, 0&, 0&)
    1297. vF9 = "2"
    1298. End If
    1299. If vF9 = "2" And vF9text = "Up" Then
    1300. Call keybd_event(VK_F9, 0&, KEYEVENTF_KEYUP, 0&)
    1301. vF9 = "1"
    1302. End If
    1303. 'vF10
    1304. If vF10 = "1" And vF10text = "Down" Then
    1305. Call keybd_event(VK_F10, 0&, 0&, 0&)
    1306. vF10 = "2"
    1307. End If
    1308. If vF10 = "2" And vF10text = "Up" Then
    1309. Call keybd_event(VK_F10, 0&, KEYEVENTF_KEYUP, 0&)
    1310. vF10 = "1"
    1311. End If
    1312. 'vF11
    1313. If vF11 = "1" And vF11text = "Down" Then
    1314. Call keybd_event(VK_F11, 0&, 0&, 0&)
    1315. vF11 = "2"
    1316. End If
    1317. If vF11 = "2" And vF11text = "Up" Then
    1318. Call keybd_event(VK_F11, 0&, KEYEVENTF_KEYUP, 0&)
    1319. vF11 = "1"
    1320. End If
    1321. 'vF12
    1322. If vF12 = "1" And vF12text = "Down" Then
    1323. Call keybd_event(VK_F12, 0&, 0&, 0&)
    1324. vF12 = "2"
    1325. End If
    1326. If vF12 = "2" And vF12text = "Up" Then
    1327. Call keybd_event(VK_F12, 0&, KEYEVENTF_KEYUP, 0&)
    1328. vF12 = "1"
    1329. End If
    1330. 'vNumlock
    1331. If vNumlock = "1" And vNumlocktext = "Down" Then
    1332. Call keybd_event(VK_NUMLOCK, 0&, 0&, 0&)
    1333. vNumlock = "2"
    1334. End If
    1335. If vNumlock = "2" And vNumlocktext = "Up" Then
    1336. Call keybd_event(VK_NUMLOCK, 0&, KEYEVENTF_KEYUP, 0&)
    1337. vNumlock = "1"
    1338. End If
    1339. 'vScrolllock
    1340. If vScrolllock = "1" And vScrolllocktext = "Down" Then
    1341. Call keybd_event(VK_OEM_SCROLL, 0&, 0&, 0&)
    1342. vScrolllock = "2"
    1343. End If
    1344. If vScrolllock = "2" And vScrolllocktext = "Up" Then
    1345. Call keybd_event(VK_OEM_SCROLL, 0&, KEYEVENTF_KEYUP, 0&)
    1346. vScrolllock = "1"
    1347. End If
    1348. 'vLshift
    1349. If vLshift = "1" And vLshifttext = "Down" Then
    1350. Call keybd_event(VK_LSHIFT, 0&, 0&, 0&)
    1351. vLshift = "2"
    1352. End If
    1353. If vLshift = "2" And vLshifttext = "Up" Then
    1354. Call keybd_event(VK_LSHIFT, 0&, KEYEVENTF_KEYUP, 0&)
    1355. vLshift = "1"
    1356. End If
    1357. 'vRshift
    1358. If vRshift = "1" And vRshifttext = "Down" Then
    1359. Call keybd_event(VK_RSHIFT, 0&, 0&, 0&)
    1360. vRshift = "2"
    1361. End If
    1362. If vRshift = "2" And vRshifttext = "Up" Then
    1363. Call keybd_event(VK_RSHIFT, 0&, KEYEVENTF_KEYUP, 0&)
    1364. vRshift = "1"
    1365. End If
    1366. 'vLstrg
    1367. If vLstrg = "1" And vLstrgtext = "Down" Then
    1368. Call keybd_event(VK_LCONTROL, 0&, 0&, 0&)
    1369. vLstrg = "2"
    1370. End If
    1371. If vLstrg = "2" And vLstrgtext = "Up" Then
    1372. Call keybd_event(VK_LCONTROL, 0&, KEYEVENTF_KEYUP, 0&)
    1373. vLstrg = "1"
    1374. End If
    1375. 'vRstrg
    1376. If vRstrg = "1" And vRstrgtext = "Down" Then
    1377. Call keybd_event(VK_RCONTROL, 0&, 0&, 0&)
    1378. vRstrg = "2"
    1379. End If
    1380. If vRstrg = "2" And vRstrgtext = "Up" Then
    1381. Call keybd_event(VK_RCONTROL, 0&, KEYEVENTF_KEYUP, 0&)
    1382. vRstrg = "1"
    1383. End If
    1384. 'vLalt
    1385. If vLalt = "1" And vLalttext = "Down" Then
    1386. Call keybd_event(VK_LMENU, 0&, 0&, 0&)
    1387. vLalt = "2"
    1388. End If
    1389. If vLalt = "2" And vLalttext = "Up" Then
    1390. Call keybd_event(VK_LMENU, 0&, KEYEVENTF_KEYUP, 0&)
    1391. vLalt = "1"
    1392. End If
    1393. 'vRalt
    1394. If vRalt = "1" And vRalttext = "Down" Then
    1395. Call keybd_event(VK_RMENU, 0&, 0&, 0&)
    1396. vRalt = "2"
    1397. End If
    1398. If vRalt = "2" And vRalttext = "Up" Then
    1399. Call keybd_event(VK_RMENU, 0&, KEYEVENTF_KEYUP, 0&)
    1400. vRalt = "1"
    1401. End If
    1402. 'vsimikolon
    1403. If vsimikolon = "1" And vsimikolontext = "Down" Then
    1404. Call keybd_event(VK_OEM_1, 0&, 0&, 0&)
    1405. vsimikolon = "2"
    1406. End If
    1407. If vsimikolon = "2" And vsimikolontext = "Up" Then
    1408. Call keybd_event(VK_OEM_1, 0&, KEYEVENTF_KEYUP, 0&)
    1409. vsimikolon = "1"
    1410. End If
    1411. 'vplus
    1412. If vplus = "1" And vplustext = "Down" Then
    1413. Call keybd_event(VK_OEM_PLUS, 0&, 0&, 0&)
    1414. vplus = "2"
    1415. End If
    1416. If vplus = "2" And vplustext = "Up" Then
    1417. Call keybd_event(VK_OEM_PLUS, 0&, KEYEVENTF_KEYUP, 0&)
    1418. vplus = "1"
    1419. End If
    1420. 'vkomma
    1421. If vkomma = "1" And vkommatext = "Down" Then
    1422. Call keybd_event(VK_OEM_COMMA, 0&, 0&, 0&)
    1423. vkomma = "2"
    1424. End If
    1425. If vkomma = "2" And vkommatext = "Up" Then
    1426. Call keybd_event(VK_OEM_COMMA, 0&, KEYEVENTF_KEYUP, 0&)
    1427. vkomma = "1"
    1428. End If
    1429. 'vMinus
    1430. If vMinus = "1" And vMinustext = "Down" Then
    1431. Call keybd_event(VK_OEM_MINUS, 0&, 0&, 0&)
    1432. vMinus = "2"
    1433. End If
    1434. If vMinus = "2" And vMinustext = "Up" Then
    1435. Call keybd_event(VK_OEM_MINUS, 0&, KEYEVENTF_KEYUP, 0&)
    1436. vMinus = "1"
    1437. End If
    1438. 'vPunkt
    1439. If vPunkt = "1" And vPunkttext = "Down" Then
    1440. Call keybd_event(VK_OEM_PERIOD, 0&, 0&, 0&)
    1441. vPunkt = "2"
    1442. End If
    1443. If vPunkt = "2" And vPunkttext = "Up" Then
    1444. Call keybd_event(VK_OEM_PERIOD, 0&, KEYEVENTF_KEYUP, 0&)
    1445. vPunkt = "1"
    1446. End If
    1447. 'vGeteil
    1448. If vGeteil = "1" And vGeteiltext = "Down" Then
    1449. Call keybd_event(VK_OEM_2, 0&, 0&, 0&)
    1450. vGeteil = "2"
    1451. End If
    1452. If vGeteil = "2" And vGeteiltext = "Up" Then
    1453. Call keybd_event(VK_OEM_2, 0&, KEYEVENTF_KEYUP, 0&)
    1454. vGeteil = "1"
    1455. End If
    1456. 'vStich
    1457. If vStich = "1" And vStichtext = "Down" Then
    1458. Call keybd_event(VK_OEM_3, 0&, 0&, 0&)
    1459. vStich = "2"
    1460. End If
    1461. If vStich = "2" And vStichtext = "Up" Then
    1462. Call keybd_event(VK_OEM_3, 0&, KEYEVENTF_KEYUP, 0&)
    1463. vStich = "1"
    1464. End If
    1465. 'vEklammera
    1466. If vEklammera = "1" And vEklammeratext = "Down" Then
    1467. Call keybd_event(VK_OEM_4, 0&, 0&, 0&)
    1468. vEklammera = "2"
    1469. End If
    1470. If vEklammera = "2" And vEklammeratext = "Up" Then
    1471. Call keybd_event(VK_OEM_4, 0&, KEYEVENTF_KEYUP, 0&)
    1472. vEklammera = "1"
    1473. End If
    1474. 'vGeteilb
    1475. If vGeteilb = "1" And vGeteilbtext = "Down" Then
    1476. Call keybd_event(VK_OEM_5, 0&, 0&, 0&)
    1477. vGeteilb = "2"
    1478. End If
    1479. If vGeteilb = "2" And vGeteilbtext = "Up" Then
    1480. Call keybd_event(VK_OEM_5, 0&, KEYEVENTF_KEYUP, 0&)
    1481. vGeteilb = "1"
    1482. End If
    1483. 'vEklammerb
    1484. If vEklammerb = "1" And vEklammerbtext = "Down" Then
    1485. Call keybd_event(VK_OEM_6, 0&, 0&, 0&)
    1486. vEklammerb = "2"
    1487. End If
    1488. If vEklammerb = "2" And vEklammerbtext = "Up" Then
    1489. Call keybd_event(VK_OEM_6, 0&, KEYEVENTF_KEYUP, 0&)
    1490. vEklammerb = "1"
    1491. End If
    1492. 'vLwin
    1493. If vLwin = "1" And vLwintext = "Down" Then
    1494. Call keybd_event(VK_LWIN, 0&, 0&, 0&)
    1495. vLwin = "2"
    1496. End If
    1497. If vLwin = "2" And vLwintext = "Up" Then
    1498. Call keybd_event(VK_LWIN, 0&, KEYEVENTF_KEYUP, 0&)
    1499. vLwin = "1"
    1500. End If
    1501. End Sub
    Alles anzeigen


    Vielen Dank im Voraus,

    Mit freundlichen Grüßen

    RoBlon
    [COLOR="Blue"][SIZE="3"][COLOR="Yellow"][COLOR="DarkOrange"]*[/color][COLOR="Orange"]*[/color]*[/color] FreeSoft-Board.to 4 [COLOR="Lime"]EVER[/color] [COLOR="Yellow"]*[COLOR="Orange"]*[/color][COLOR="DarkOrange"]*[/color][/color][/SIZE][/color]
  • So ganz spontan: arbeite mit einem Array, dass die ganzen Tastencodes und -kürzel enthält. Du kannst dann in einer Schleife abfragen, ob das aktuelle Event auf irgendeine Taste in dem Array passt und entsprechend darauf reagieren, anstatt jeden einzelnen Wert in einer Variable abzufragen. So kannst du die ewig lange If-Abfrage auf eine kleine Schleife reduzieren. Für die vielen Deklarationen gibt es bestimmt auch einen weg. Eventuell lassen die sich auch in das Array packen ;)

    HTH
    "Ich habe ein einfaches Rezept, um fit zu bleiben - Ich laufe jeden Tag Amok."
    [SIZE="1"]Hildegard Knef (1925-2002), dt. Schauspielerin, Chansonsängerin und Autorin [/SIZE]
  • HI,

    erstmal vielen dank für deine Antwort,
    hast du zufällig ne kleinen Source Code... also so, damit ich mich da mal reíndenken kann ???? ;)

    Vielen Dank im Voraus.

    MFG
    RoBlon
    [COLOR="Blue"][SIZE="3"][COLOR="Yellow"][COLOR="DarkOrange"]*[/color][COLOR="Orange"]*[/color]*[/color] FreeSoft-Board.to 4 [COLOR="Lime"]EVER[/color] [COLOR="Yellow"]*[COLOR="Orange"]*[/color][COLOR="DarkOrange"]*[/color][/color][/SIZE][/color]
  • Sry, aber beschäftige dich mal mit Funktionen ... du hast ja zig-mal das gleiche aufgeschrieben. Von VB hab ich keine Ahnung, aber mach doch ne Funktion wo du die Variable übergibst, weil du macht ja überall das gleiche.

    mfg
    Tischler
  • @Tischler

    Hi,
    hab ich schon probiert, das geht nur wenn man eine Taste drückt, wenn mehrere Tasen gleichzeitig gedrückt (auf dem Gamepad) werden dann wird immer nur einen Taste simuliert..... sogehts leider nicht, oder vllt weiß du ja noch eine andere lösung....

    MFG
    RoBlon
    [COLOR="Blue"][SIZE="3"][COLOR="Yellow"][COLOR="DarkOrange"]*[/color][COLOR="Orange"]*[/color]*[/color] FreeSoft-Board.to 4 [COLOR="Lime"]EVER[/color] [COLOR="Yellow"]*[COLOR="Orange"]*[/color][COLOR="DarkOrange"]*[/color][/color][/SIZE][/color]
  • Ich muss den anderen recht geben, du wiederholst ein und den selben Text immer wieder und wieder...
    Ist schon ein wenig dumm, sorry ^^
    Also ich mein, ich hätte gar nicht an solch einem Code geschrieben, weil es mir zu dumm wäre, ständig Copy&Paste zu machen.
    Mit VB kenn ich mich aber auch nicht aus.
    Setz dich halt mit Arrays auseinander, dann passt das sehr bald schon.
    Oder googel nach ähnlichen Problemen und ihren Lösungen...

    MfG
    trxag
  • HI,

    @trxag, da du ja von VB6 nichts verstehst, wieso mischt du dich dann da überhaupt ein, ich finde dein Post ist echt....
    naja aber immer hin haste jetzt +1 Post......
    Außerdem hat es den Anschein das du nicht weiß, das man Programme programmieren kann die diesen 1700 Zeilen langen Code in 2-3Sekunden erstellt haben.....
    Denn ich bin ja nicht blöd, und mach das alles von hand... ich hab mir ne prog geschieben was alles passend zusammenbaut.....
    und das mit den Arrays zum allgemeinen Verkürzen kannste knicken, da es probleme macht wenn man am gamepad mehrere Tasten auf ein mal drückt....
    Trotzdem Nochmal danke für den unnützigen doppelpost.....


    MFG

    RoBlon

    PS: Vllt hat ja jemand noch eine andere SINNVOLLE idee....
    [COLOR="Blue"][SIZE="3"][COLOR="Yellow"][COLOR="DarkOrange"]*[/color][COLOR="Orange"]*[/color]*[/color] FreeSoft-Board.to 4 [COLOR="Lime"]EVER[/color] [COLOR="Yellow"]*[COLOR="Orange"]*[/color][COLOR="DarkOrange"]*[/color][/color][/SIZE][/color]
  • Na, halt mal den Ball flach - wir haben uns doch alle lieb ;)

    Was ich nicht so ganz verstehe, warum das mit einem Array nicht funktionieren soll? Es spielt doch keine Rolle, ob du nun die Events aus einem Array ausliest und darauf reagierst oder ob du in einer großen If-Abfrage die Events einzeln abfragst und verarbeitest. Außerdem hättest du doch schon ein Array mit den einzelnen Events und ihren Status (nein, Stati gibt es nicht :D ), wenn du den Code-Block dynamisch erzeugst :P

    Um das mit dem Array mal etwa genauer zu erkären: Du machst ja nichts anderes, als immer wieder die gleiche If-Abfrage auf verschiedene Werte zu setzen. Das kannst du verkürzen, indem du die Werte in einem mehrdimensionalen und eventuell assoziativen Array ablegst und dann dieses Array durchläufst und an eine einzige If-Abfrage übergibts. Beugt Tipp-Fehler vor und macht das Ganze viel übersichtlicher. Hier mal etwas Pseudo-Code. Lang, lang ist's her, als ich VB gebastelt habe :D

    Quellcode

    1. var keys = array(array('taste' => 'back1',
    2. 'status' => 0,
    3. 'text' => 'Up'
    4. 'event' => VK_BACK1),
    5. array('taste' => 'back2',
    6. 'status' => 0,
    7. 'event' => VK_BACK2)
    8. array('taste' => 'back3',
    9. 'status' => 0,
    10. 'event' => VK_BACK3));
    11. function Tastendruck() {
    12. global keys;
    13. foreach(keys as key) {
    14. if(key['taste'] = gedrucktetaste) {
    15. if(key['status'] = 1 and key['text'] = 'Down') {
    16. call key_event(key['event'], null, null, ...);
    17. }
    18. if(key['status'] = 2 and key['text'] = 'Up') {
    19. call key_event(key['event'], null, null, ...);
    20. }
    21. }
    22. }
    23. }
    Alles anzeigen

    Nur mal so zur Veranschaulichung, wie's funktionieren könnte. Du musst nur noch deinen Code darauf portieren; eine 1:1 Anleitung ist es nicht, denn ich weiß ja nicht genau, was du mit deinem Code bewirken willst und ich bin auch zu faul, mich jetzt näher damit zu befassen ;)

    HTH
    "Ich habe ein einfaches Rezept, um fit zu bleiben - Ich laufe jeden Tag Amok."
    [SIZE="1"]Hildegard Knef (1925-2002), dt. Schauspielerin, Chansonsängerin und Autorin [/SIZE]