Template:Snippet Header: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
= | <includeonly> | ||
<div style="background-color:white; padding: 1em; border:2px; solid; #8FBC8F";> | |||
{{ #if: {{{AuthorURL|}}} | '''Author: [http://www.autoitscript.com/forum/user/{{{AuthorURL}}} {{{AuthorName}}} ]''' | '''{{{AuthorName}}}''' }} | |||
{{ #if: {{{ModifierURL|}}} | <br> '''Modified: [http://www.autoitscript.com/forum/user/{{{ModifierURL|}}} {{{ModifierName|}}} ]''' }} | {{ #if: {{{ModifierURL|}}} | <br> '''Modified: [http://www.autoitscript.com/forum/user/{{{ModifierURL|}}} {{{ModifierName|}}} ]''' }} | ||
{{ #if: {{{ModifierURL2|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL2|}}} {{{ModifierName2|}}}]''' }} | {{ #if: {{{ModifierURL2|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL2|}}} {{{ModifierName2|}}}]''' }} | ||
{{ #if: {{{ModifierURL3|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL3|}}} {{{ModifierName3|}}}]''' }} | {{ #if: {{{ModifierURL3|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL3|}}} {{{ModifierName3|}}}]''' }} | ||
{{ #if: {{{ModifierURL4|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL4|}}} {{{ModifierName4|}}}]''' }} | {{ #if: {{{ModifierURL4|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL4|}}} {{{ModifierName4|}}}]''' }} | ||
{{ #if: | {{ #if: {{ModifierURL5|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL5|}}} {{{ModifierName5|}}}]''' }} | ||
{{ #if: {{{Desc|}}} | <br> <br> {{{Desc}}} }} | |||
</div> | |||
</includeonly> | |||
<div style="background-color:#FAEBD7; padding: 15px; padding-bottom: 3px; border-bottom: 1px solid #aaa; margin-bottom: 1ex;"> | |||
< | <pre> | ||
Note that the entire URL is not needed. | |||
Up to five modifiers. If more are needed then edit this template accordingly. | |||
{{ | {{ | ||
Snippet Header | |||
| AuthorURL = 35302-guinness Optional. | |||
| AuthorName = guinness | |||
| ModifiedURL = Optional. | |||
| ModifiedName = Optional. | |||
| ModifiedURL2 = Optional. | |||
| ModifiedName2 = Optional. | |||
| ModifiedURL3 = Optional. | |||
| ModifiedName3 = Optional. | |||
| ModifiedURL4 = Optional. | |||
| ModifiedName4 = Optional. | |||
| ModifiedURL5 = Optional. | |||
| ModifiedName5 = Optional. | |||
| Desc = This is a short description of the snippet. Optional. | |||
}} | |||
</pre> | |||
== _WinAPI_SwapMouseButton == | |||
{{Snippet Header | {{Snippet Header | ||
| AuthorURL = 35302-guinness | |||
|AuthorURL=35302-guinness | | AuthorName = guinness | ||
|AuthorName=guinness | | Desc = This is a snippet from the wiki used to demonstrate the template.}} | ||
| | |||
<syntaxhighlight lang="autoit"> | |||
Example() | Example() | ||
Line 48: | Line 69: | ||
Return $aReturn[0] | Return $aReturn[0] | ||
EndFunc ;==>_WinAPI_SwapMouseButton | EndFunc ;==>_WinAPI_SwapMouseButton | ||
</syntaxhighlight> | |||
</div> |
Revision as of 19:10, 13 November 2012
Note that the entire URL is not needed. Up to five modifiers. If more are needed then edit this template accordingly. {{ Snippet Header | AuthorURL = 35302-guinness Optional. | AuthorName = guinness | ModifiedURL = Optional. | ModifiedName = Optional. | ModifiedURL2 = Optional. | ModifiedName2 = Optional. | ModifiedURL3 = Optional. | ModifiedName3 = Optional. | ModifiedURL4 = Optional. | ModifiedName4 = Optional. | ModifiedURL5 = Optional. | ModifiedName5 = Optional. | Desc = This is a short description of the snippet. Optional. }}
_WinAPI_SwapMouseButton
Note that the entire URL is not needed. Up to five modifiers. If more are needed then edit this template accordingly. {{ Snippet Header | AuthorURL = 35302-guinness Optional. | AuthorName = guinness | ModifiedURL = Optional. | ModifiedName = Optional. | ModifiedURL2 = Optional. | ModifiedName2 = Optional. | ModifiedURL3 = Optional. | ModifiedName3 = Optional. | ModifiedURL4 = Optional. | ModifiedName4 = Optional. | ModifiedURL5 = Optional. | ModifiedName5 = Optional. | Desc = This is a short description of the snippet. Optional. }}
_WinAPI_SwapMouseButton
Template loop detected: Template:Snippet Header
Example()
Func Example()
; Swap the left button to generate right-button messages and vice versa.
ConsoleWrite(_WinAPI_SwapMouseButton(True) & @CRLF)
; Wait for the user to see the changes.
Sleep(10000)
; Change the mouse buttons back to their original meanings.
ConsoleWrite(_WinAPI_SwapMouseButton(False) & @CRLF)
EndFunc ;==>Example
; If $fFlag is True, the left button generates right-button messages and the right button generates left-button messages.
; If $fFlag is False, the buttons are restored to their original meanings.
Func _WinAPI_SwapMouseButton($fFlag)
Local $aReturn = DllCall('user32.dll', 'int', 'SwapMouseButton', 'int', $fFlag)
If @error Then
Return SetError(1, 0, 0)
EndIf
Return $aReturn[0]
EndFunc ;==>_WinAPI_SwapMouseButton
Example()
Func Example()
; Swap the left button to generate right-button messages and vice versa.
ConsoleWrite(_WinAPI_SwapMouseButton(True) & @CRLF)
; Wait for the user to see the changes.
Sleep(10000)
; Change the mouse buttons back to their original meanings.
ConsoleWrite(_WinAPI_SwapMouseButton(False) & @CRLF)
EndFunc ;==>Example
; If $fFlag is True, the left button generates right-button messages and the right button generates left-button messages.
; If $fFlag is False, the buttons are restored to their original meanings.
Func _WinAPI_SwapMouseButton($fFlag)
Local $aReturn = DllCall('user32.dll', 'int', 'SwapMouseButton', 'int', $fFlag)
If @error Then
Return SetError(1, 0, 0)
EndIf
Return $aReturn[0]
EndFunc ;==>_WinAPI_SwapMouseButton