Advertisement
Guest User

Untitled

a guest
Jul 28th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. 91 <-kyecode kropki na numerycznej
  2.  
  3. Znalezc urzadzenie: xinput --list
  4. Tak mozna znalezc klawisz: xinput --test "BTC USB Multimedia Keyboard"
  5.  
  6.  
  7. autoclicer w bashu
  8.  
  9.  
  10. xdotool click --delay 5 --repeat 900000 1
  11.  
  12. Bit late here, but here is a solution.
  13. By typing xinput --list, you get a list of all the input devices in your system.
  14. The trick is with xinput --query-state.
  15. If you go into terminal and you list the inputs, you can then do xinput --query-state [YourKeyboard].
  16.  
  17. 1 class :
  18. KeyClass
  19. key[0]=up
  20. key[1]=up
  21. key[2]=up
  22. ...
  23. Now, you will need to hold down the key, so you can either
  24.  
  25. Use > to write to a file, letting you hold down the key when you execute the command
  26. Make a quick bash script
  27.  
  28. while true; do
  29.  
  30. xinput --query-state [YourKeyboard] | grep 'down'
  31.  
  32. done
  33.  
  34. # StackExchange does not like bash
  35.  
  36. EDIT: I am not on Linux right now, so I cannot try this, but I heard you can use xinput --test as well
  37.  
  38. Once you find the correct key, make a script like this.
  39.  
  40. ?????????????????
  41. #!/bin/bash
  42. while true; do
  43.  
  44. inp=`xinput --query-state <KEYBOARD#ID> | grep -o 'button\[<KEYBOARD#BUTTON>\]=down'`
  45.  
  46. if [ ! -z "$inp" ]; then
  47.  
  48. xdotool click 1
  49.  
  50. fi
  51.  
  52. done
  53. ?????????????
  54.  
  55. This will spam click the mouse button while the user holds down a button
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. ------------
  75.  
  76.  
  77.  
  78. #!/bin/bash
  79.  
  80.  
  81.  
  82.  
  83. # 91 = kropka na numerycznej
  84. # 24 = 'q'
  85.  
  86.  
  87. while true; do
  88.  
  89. inp=$(xinput --query-state 'BTC USB Multimedia Keyboard' | grep -o 'key\[24\]=down')
  90.  
  91. if [ ! -z "$inp" ]
  92. then
  93. xdotool click --delay 5 --repeat 50 1
  94. else
  95. sleep 1
  96. fi
  97.  
  98. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement