Come si aggiunge un effetto visivo a un clic del mouse da Windows?


22

Voglio solo una piccola utility che controlli i clic del mouse in modo che quando si verifica un effetto bolla visiva (o qualcosa di simile), simile a qualcosa che potresti vedere in uno screencast.

Risposte:


21

Opzione nativa di Windows

Proprietà mouse> Opzioni puntatore> Mostra posizione puntatore

Combinato con AutoHotkey

~LButton::
Send {Ctrl}
return

~LButton UP::
Send {Ctrl}
return

Ogni clic del mouse (giù e su) si attiva Ctrlbrevemente.

Come sottolineato da Paolo, puoi anche cambiare l'impostazione del mouse come parte dello script:

DllCall("SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 1, UInt, 0) ;SPI_SETMOUSESONAR ON

OnExit, ExitSub
ExitSub:
   DllCall("SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 0, UInt, 0) ;SPI_SETMOUSESONAR OFF
   ExitApp

1
Ho risolto il suggerimento qui (e grazie per avermi messo su AutoHotKey). Mi ci sono volute ore per capire la correzione. Ho aggiunto un singolo carattere (la tilde ~) che ha permesso il normale funzionamento del mouse. Ho anche modificato l'esempio in modo che non solo un rilascio del clic del mouse, ma anche il clic del mouse iniziale generi l'effetto.

1
È possibile modificare automaticamente le impostazioni del mouse. Vedi questo link: autohotkey.com/board/topic/…
Paolo Fulgoni il

La modifica che ho apportato è stata quella di rimuovere ~ LButton e usare solo ~ LButton Up, perché avere entrambi crea un effetto sonar disgiunto, ma l'uso del solo clic su lo fa funzionare perfettamente.
Trialsman,

1

Questa è una variante della risposta di RJFalconer, che incorpora le modifiche di Paolo Fulgoni. Non volevo vedere sempre il mio mouse quando veniva premuto il pulsante CTRL e speravo che la DllInfomodifica avrebbe attivato e disattivato dinamicamente l'impostazione, ma non riuscivo a farlo funzionare (lo script sarebbe semplicemente uscito). Senza dubbio qualcuno di più sofisticato in AHK potrebbe spiegare cosa stavo facendo di sbagliato, ma sono andato avanti e ho creato la mia versione.

Attiva in modo dinamico l'opzione "Mostra mouse quando si preme il controllo" quando si preme il pulsante del mouse, quindi si spegne successivamente. Funziona bene nei test limitati, anche se a volte il puntatore del mouse scompare in seguito. Se qualcuno sa come risolverlo o ha altri miglioramenti, sentiti libero di saltarci dentro.

È (eccessivamente) documentato, perché dimentico rapidamente le cose, e quando devo rivisitare, mi piace che i miei script forniscano abbastanza informazioni da non dover cercare per trovare tutti i vecchi riferimenti che ho usato in primo luogo.

;Visualize mouse clicks by showing radiating concentric circles on mouse click
;Author: traycerb
;Date/Version: 01-31-2018
;
;Source:
;/superuser/106815/how-do-you-add-a-visual-effect-to-a-mouse-click-from-within-windows
;https://autohotkey.com/board/topic/77380-mouse-click-special-effects-for-presentationsdemos/

;Dynamically switch on the Windows accessibility feature to show the mouse when the control key is pressed
;when the script is executed, then switch off afterwards
;Windows settings > Mouse > Pointer Options tab > Visibility group > Show location of pointer when I press CTRL key



;Window's SystemParametersInfo function, retrieves or sets the value of one of the 
;system-wide parameters.  AHK DllCall fxn with SystemParameterInfo parameter is used to access
;this Windows API.
;https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx
;BOOL WINAPI SystemParametersInfo(
;  _In_    UINT  uiAction,
;  _In_    UINT  uiParam,
;  _Inout_ PVOID pvParam,
;  _In_    UINT  fWinIni
;);

;uiParam [in]
;Type: UINT
;
;A parameter whose usage and format depends on the system parameter being queried or set. 
;For more information about system-wide parameters, see the uiAction parameter. 
;If not otherwise indicated, you must specify zero for this parameter.

;pvParam [in, out]
;Type: PVOID
;
;A parameter whose usage and format depends on the system parameter being queried or set. 
;For more information about system-wide parameters, see the uiAction parameter. 
;If not otherwise indicated, you must specify NULL for this parameter. 
;For information on the PVOID datatype, see Windows Data Types.

;fWinIni [in]
;Type: UINT
;
;If a system parameter is being set, specifies whether the user profile is to be updated, 
;and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level 
;windows to notify them of the change.

;This parameter can be zero if you do not want to update the user profile 
;or broadcast the WM_SETTINGCHANGE message or it can be set to the following [...]

;Accessibility parameter    
;S0x101D PI_SETMOUSESONAR
;Turns the Sonar accessibility feature on or off. This feature briefly 
;shows several concentric circles around the mouse pointer when the user 
;presses and releases the CTRL key. 
;The pvParam parameter specifies TRUE for on and FALSE for off. 

;Press the control button each time mouse button is pressed, showing location of mouse pointer.
~LButton::
{
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 1, UInt, 0) 
  Send {Ctrl}
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 0, UInt, 0) 
  return
}

~RButton::
{
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 1, UInt, 0) 
  Send {Ctrl}
  DllCall("user32\SystemParametersInfo", UInt, 0x101D, UInt, 0, UInt, 0, UInt, 0) 
  return
}

È stato utile grazie. Ho anche aggiunto una #SingleInstance forceriga per evitare fastidiosi messaggi popup durante i doppi clic.
Phil B,
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.