Advertisement
GameEntity903

Untitled

Nov 20th, 2022 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. SetTitleMatchMode, 2
  2. GroupAdd, Gui_Blank, ahk_class AutoHotkeyGUI
  3. GroupAdd, Gui_Blank, BlankScr.ahk
  4.  
  5. !^9::
  6. count++
  7. global m := mod(count,2)
  8. mvmouse(m)
  9. return
  10.  
  11. ^F12::
  12. Run, C:\Users\Suhas\Desktop\BlankScr.ahk
  13. SystemCursor("Off")
  14. mbak := m
  15. SoundBeep
  16. WinWaitActive, ahk_group Gui_Blank
  17. mvmouse(1)
  18. SoundBeep
  19. WinWaitNotActive, ahk_group Gui_Blank
  20. SoundBeep
  21. mvmouse(mbak)
  22. SystemCursor("On")
  23. return
  24.  
  25. SystemCursor(OnOff=1) ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
  26. {
  27. static AndMask, XorMask, $, h_cursor
  28. ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
  29. , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13 ; blank cursors
  30. , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13 ; handles of default cursors
  31. if (OnOff = "Init" or OnOff = "I" or $ = "") ; init when requested or at first call
  32. {
  33. $ := "h" ; active default cursors
  34. VarSetCapacity( h_cursor,4444, 1 )
  35. VarSetCapacity( AndMask, 32*4, 0xFF )
  36. VarSetCapacity( XorMask, 32*4, 0 )
  37. system_cursors := "32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650"
  38. StringSplit c, system_cursors, `,
  39. Loop %c0%
  40. {
  41. h_cursor := DllCall( "LoadCursor", "Ptr",0, "Ptr",c%A_Index% )
  42. h%A_Index% := DllCall( "CopyImage", "Ptr",h_cursor, "UInt",2, "Int",0, "Int",0, "UInt",0 )
  43. b%A_Index% := DllCall( "CreateCursor", "Ptr",0, "Int",0, "Int",0
  44. , "Int",32, "Int",32, "Ptr",&AndMask, "Ptr",&XorMask )
  45. }
  46. }
  47. if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
  48. $ := "b" ; use blank cursors
  49. else
  50. $ := "h" ; use the saved cursors
  51.  
  52. Loop %c0%
  53. {
  54. h_cursor := DllCall( "CopyImage", "Ptr",%$%%A_Index%, "UInt",2, "Int",0, "Int",0, "UInt",0 )
  55. DllCall( "SetSystemCursor", "Ptr",h_cursor, "UInt",c%A_Index% )
  56. }
  57. }
  58.  
  59. mvmouse(val)
  60. {
  61. valm := mod(val, 2)
  62. if(valm = 1)
  63. {
  64. SetTimer, MoveMouse,
  65. MoveMouse:
  66. If ( A_TimeIdle > 59000 )
  67. {
  68. MouseMove, 1, 0,, R
  69. MouseMove, -1, 0,, R
  70. }
  71. return
  72. }
  73. Return
  74. }
  75.  
  76.  
  77. C:\Users\Suhas\Desktop\BlankScr.ahk is a separate script whose contents are pasted below.
  78.  
  79.  
  80. Gui, Color, black
  81. Gui +AlwaysOnTop
  82. Gui -Caption
  83. Gui, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%
  84. return
  85. esc::exitapp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement