AutoHotkey Community

It is currently May 25th, 2012, 3:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: September 12th, 2007, 12:50 am 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Code:
; hotkeys need a label, so give them one that do nothing
DummyLabel:
Return
; ______________________________________________________________________________

DisableKeyboard()
{
   static keys=Space,Enter,Tab,Esc,BackSpace,Del,Ins,Home,End,PgDn,PgUp,Up,Down,Left,Right,CtrlBreak,ScrollLock,PrintScreen,CapsLock
,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadDot,NumpadDiv,NumpadMult,NumpadAdd
,NumpadSub,NumpadEnter,NumpadIns,NumpadEnd,NumpadDown,NumpadPgDn,NumpadLeft,NumpadClear,NumpadRight,NumpadHome,NumpadUp,NumpadPgUp,NumpadDel
,Media_Next,Media_Play_Pause,Media_Prev,Media_Stop,Browser_Back,Browser_Favorites,Browser_Home,Browser_Refresh,Browser_Search,Browser_Stop
,Launch_App1,Launch_App2,Launch_Mail,Launch_Media
,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
,²,&,é,",',(,-,è,_,ç,à,),=,$,£,ù,*,~,#,{,[,|,``,\,^,@,],},`,,;,:,!,?,.,/,§,<,>
   Loop,Parse,keys, `,
      Hotkey, *%A_LoopField%, DummyLabel
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 12:52 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
You forgot *some

[code]Alt + 1 = ☺
Alt + 2 = ☻
Alt + 3 = ♥
Alt + 4 = ♦
Alt + 5 = ♣
Alt + 6 = ♠
Alt + 7 = •
Alt + 8 = ◘
Alt + 9 = ○
Alt + 10 = ◙
Alt + 11 = ♂
Alt + 12 = ♀
Alt + 13 = ♪
Alt + 14 = ♫
Alt + 15 = ☼
Alt + 16 = ►
Alt + 17 = ◄
Alt + 18 = ↕
Alt + 19 = ‼
Alt + 20 = ¶
Alt + 21 = §
Alt + 22 = ▬
Alt + 23 = ↨
Alt + 24 = ↑
Alt + 25 = ↓
Alt + 26 = →
Alt + 27 = ←
Alt + 28 = ∟
Alt + 29 = ↔
Alt + 30 = ▲
Alt + 31 = ▼
Alt + 32 =
Alt + 33 = !
Alt + 34 = "
Alt + 35 = #
Alt + 36 = $
Alt + 37 = %
Alt + 38 = &
Alt + 39 = '
Alt + 40 = (
Alt + 41 = )
Alt + 42 = *
Alt + 43 = +
Alt + 44 = ,
Alt + 45 = -
Alt + 46 = .
Alt + 47 = /
Alt + 48 = 0
Alt + 49 = 1
Alt + 50 = 2
Alt + 51 = 3
Alt + 52 = 4
Alt + 53 = 5
Alt + 54 = 6
Alt + 55 = 7
Alt + 56 = 8
Alt + 57 = 9
Alt + 58 = :
Alt + 59 = ;
Alt + 60 = <
Alt + 61 = =
Alt + 62 = >
Alt + 63 = ?
Alt + 64 = @
Alt + 65 = A
Alt + 66 = B
Alt + 67 = C
Alt + 68 = D
Alt + 69 = E
Alt + 70 = F
Alt + 71 = G
Alt + 72 = H
Alt + 73 = I
Alt + 74 = J
Alt + 75 = K
Alt + 76 = L
Alt + 77 = M
Alt + 78 = N
Alt + 79 = O
Alt + 80 = P
Alt + 81 = Q
Alt + 82 = R
Alt + 83 = S
Alt + 84 = T
Alt + 85 = U
Alt + 86 = V
Alt + 87 = W
Alt + 88 = X
Alt + 89 = Y
Alt + 90 = Z
Alt + 91 = [
Alt + 92 = ..
Alt + 93 = ]
Alt + 94 = ^
Alt + 95 = _
Alt + 96 = ..
Alt + 97 = a
Alt + 98 = b
Alt + 99 = c
Alt + 100 = d
Alt + 101 = e
Alt + 102 = f
Alt + 103 = g
Alt + 104 = h
Alt + 105 = i
Alt + 106 = j
Alt + 107 = k
Alt + 108 = l
Alt + 109 = m
Alt + 110 = n
Alt + 111 = o
Alt + 112 = p
Alt + 113 = q
Alt + 114 = r
Alt + 115 = s
Alt + 116 = t
Alt + 117 = u
Alt + 118 = v
Alt + 119 = w
Alt + 120 = x
Alt + 121 = y
Alt + 122 = z
Alt + 123 = {
Alt + 124 = |
Alt + 125 = }
Alt + 126 = ~
Alt + 127 = ⌂
Alt + 128 = Ç
Alt + 129 = ü
Alt + 130 = é
Alt + 131 = â
Alt + 132 = ä
Alt + 133 = à
Alt + 134 = å
Alt + 135 = ç
Alt + 136 = ê
Alt + 137 = ë
Alt + 138 = è
Alt + 139 = ï
Alt + 140 = î
Alt + 141 = ì
Alt + 142 = Ä
Alt + 143 = Å
Alt + 144 = É
Alt + 145 = æ
Alt + 146 = Æ
Alt + 147 = ô
Alt + 148 = ö
Alt + 149 = ò
Alt + 150 = û
Alt + 151 = ù
Alt + 152 = ÿ
Alt + 153 = Ö
Alt + 154 = Ü
Alt + 155 = ¢
Alt + 156 = £
Alt + 157 = ¥
Alt + 158 = ,,
Alt + 159 = ƒ
Alt + 160 = á
Alt + 161 = í
Alt + 162 = ó
Alt + 163 = ú
Alt + 164 = ñ
Alt + 165 = Ñ
Alt + 166 = ª
Alt + 167 = ▒
Alt + 168 = ¿
Alt + 169 = ⌐
Alt + 170 = ¬
Alt + 171 = ½
Alt + 172 = ¼
Alt + 173 = ¡
Alt + 174 = «
Alt + 175 = »
Alt + 176 = ░
Alt + 177 = ▒
Alt + 178 = ▓
Alt + 179 = │
Alt + 180 = ┤
Alt + 181 = ╡
Alt + 182 = ╢
Alt + 183 = ╖
Alt + 184 = ╕
Alt + 185 = ╣
Alt + 186 = ║
Alt + 187 = ╗
Alt + 188 = ╝
Alt + 189 = ╜
Alt + 190 = ╛
Alt + 191 = ┐
Alt + 192 = └
Alt + 193 = ┴
Alt + 194 = ├
Alt + 195 = ├
Alt + 196 = ─
Alt + 197 = ┼
Alt + 198 = ╞
Alt + 199 = ╟
Alt + 200 = ╚
Alt + 201 = ╔
Alt + 202 = ╩
Alt + 203 = ╦
Alt + 204 = ╠
Alt + 205 = ═
Alt + 206 = ╬
Alt + 207 = ╧
Alt + 208 = ╨
Alt + 209 = ╤
Alt + 210 = ╥
Alt + 211 = ╙
Alt + 212 = ╘
Alt + 213 = ╒
Alt + 214 = ╓
Alt + 215 = ╫
Alt + 216 = ╪
Alt + 217 = ┘
Alt + 218 = ┌
Alt + 219 = █
Alt + 220 = ▄
Alt + 221 = ▌
Alt + 222 = ▐
Alt + 223 = ▀
Alt + 224 = ,,
Alt + 225 = ß
Alt + 226 = ,,
Alt + 227 = ,,
Alt + 228 = ,,
Alt + 229 = ,,
Alt + 230 = µ
Alt + 231 = ,,
Alt + 232 = ,,
Alt + 233 = ,,
Alt + 234 = ,,
Alt + 235 = ,,
Alt + 236 = ∞
Alt + 237 = ,,
Alt + 238 = ,,
Alt + 239 = ,,
Alt + 240 = ,,
Alt + 241 = ±
Alt + 242 = ,,
Alt + 243 = ,,
Alt + 244 = ,,
Alt + 245 = ,,
Alt + 246 = ÷
Alt + 247 = ≈
Alt + 248 = °
Alt + 249 = ∙
Alt + 250 = ·
Alt + 251 = ,,
Alt + 252 = ,,
Alt + 253 = ²
Alt + 254 = ■
Alt + 0128 = €
Alt + 0130 = ‚
Alt + 0131 = ƒ
Alt + 0132 = „
Alt + 0133 = …
Alt + 0134 = †
Alt + 0135 = ‡
Alt + 0136 = ,,
Alt + 0137 = ‰
Alt + 0138 = ,,
Alt + 0139 = ‹
Alt + 0140 = ,,
Alt + 0141 =

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 1:08 am 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
I don't see your point :?
These are ascii codes, not keys.
If you have a better solution, then please post it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 1:10 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Just being sarcastic. But anyways.. Gimme a sec to come up with one.

Got it:

Code:
Loop
{
Input, OutputVar
}
Return

~LButton & RButton:: ; Press both the left and right mouse buttons
ExitApp
Return

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 1:26 am 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Nice try :) but this is not the same. :wink:
Yours only works using the mouse buttons as hotkey. It won't if the hotkey is based on keyboard.
And how do you stop it without a hotkey at all?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 1:27 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Code:
SetTimer, Stop, 60000 ; 1 Minute

Loop
{
Input, OutputVar
}
Return

Stop:
ExitApp


:?:

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2007, 3:08 am 
Offline

Joined: May 17th, 2007, 9:06 pm
Posts: 421
Location: England
Andreone wrote:
And how do you stop it without a hotkey at all?

Like was said in the original post
There will be a Gui with a button that says "Enable Keyboard Input" or similar
Thereby negating the need for a hotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 12:21 am 
You Cant break the Input 99999 above, its still waiting for the next 999999 keys. :) Cheers.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 4:30 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
@Andreone: Looks like you added "static" at the last minute and didn't test...
Code:
static keys=Space,Enter,Tab,...
Quote:
---------------------------
~acc.tmp
---------------------------
Error at line 13.

Line Text: Space
Error: Unsupported static initializer.

The program will exit.
---------------------------
OK
---------------------------
(You missed quote marks.)

Also, you missed a bunch of keys:
Code:
LWin,RWin,LAlt,RAlt,LCtrl,RCtrl,LShift,RShift,AppsKey,vkBC,Pause,Volume_Mute,Volume_Up,Volume_Down
:) (vkBC is comma--the`, in your list is interpreted as a delimiter.)

You missed F13-F24. :P (My "Close" button is reported as F22.) I also have a few keys that have only scancodes, which your script doesn't block.

Keyboard hook method:
Code:
#Persistent

; The keyboard hook doesn't block mouse buttons, so this can toggle kb block.
XButton1::BlockKeyboard()

; This can only execute if the keyboard is NOT blocked,
; so it can't be used to unblock the keyboard.
^Space::
    KeyWait, Ctrl ; don't block Ctrl key-up
    KeyWait, Space ; or space-up
    BlockKeyboard()
return

BlockKeyboard(block=-1) ; -1, true or false.
{
    static hHook = 0, cb = 0
    if !cb ; register callback once only.
        cb := RegisterCallback("BlockKeyboard_HookProc")
   
    if (block = -1) ; toggle
        block := (hHook=0)
   
    if ((hHook!=0) = (block!=0)) ; already (un)blocked, no action necessary.
        return
   
    if (block)
        hHook := DllCall("SetWindowsHookEx"
            , "int", 13  ; WH_KEYBOARD_LL
            , "uint", cb ; lpfn (callback)
            , "uint", 0  ; hMod (NULL)
            , "uint", 0) ; dwThreadId (all threads)
    else {
        DllCall("UnhookWindowsHookEx", "uint", hHook)
        hHook = 0
    }
}

BlockKeyboard_HookProc(nCode, wParam, lParam)
{
    static count = 0
    ; Optional: built-in disable mechanism.
    if (NumGet(lParam+8) & 0x80) { ; key up
        if (NumGet(lParam+4) = 0x4D && !(NumGet(lParam+8) & 1)) { ; Numpad 6
            if (++count = 3)
                BlockKeyboard(false)
        } else
            count = 0
    }
   
    return 1
}

Actually, the Input method works almost as well. I believe AutoHotkey uses the keyboard hook for Input, so it blocks all keys (including those with scancodes but no virtual keycode) except for the modifier keys. (The start menu can still be opened...)

Btw, the Loop doesn't seem to be necessary:
Code:
Input, OutputVar, T10 ; 10 second timeout
ExitApp
~RButton::Input  ; cancels Input
Input can be used to cancel the block without exiting. (Though in this example, the script exits either way...)

Strangely, the built-in BlockInput command doesn't work at all for me. (Vista issue, perhaps?)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2007, 8:50 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
:oops:
Quote:
@Andreone: Looks like you added "static" at the last minute and didn't test...
Oups, you got me :)
Quote:
Also, you missed a bunch of keys:
Thanks for mentionned it. I'll add those keys. However, not blocking Ctrl, ALt and Shift was intentional: the all thing is to be able to block the keyboard and also unblock it with a hotkey, so some keys must not be blocked.
This way, defining a hotkey to unblock before calling the function, the hotkey will work.
Here's my last version (tested this time :) ):
Code:
; Function:
;    BlockKeyboardInputs(state="On") disables all keyboard key presses,
;   but Control, Shift, Alt (thus a hotkey based on these keys can be used to unblock the keyboard)
;
; Param
;   state [in]: On or Off
;
BlockKeyboardInputs(state = "On")
{
   static keys
   keys=Space,Enter,Tab,Esc,BackSpace,Del,Ins,Home,End,PgDn,PgUp,Up,Down,Left,Right,CtrlBreak,ScrollLock,PrintScreen,CapsLock
,Pause,AppsKey,LWin,LWin,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadDot
,NumpadDiv,NumpadMult,NumpadAdd,NumpadSub,NumpadEnter,NumpadIns,NumpadEnd,NumpadDown,NumpadPgDn,NumpadLeft,NumpadClear
,NumpadRight,NumpadHome,NumpadUp,NumpadPgUp,NumpadDel,Media_Next,Media_Play_Pause,Media_Prev,Media_Stop,Volume_Down,Volume_Up
,Volume_Mute,Browser_Back,Browser_Favorites,Browser_Home,Browser_Refresh,Browser_Search,Browser_Stop,Launch_App1,Launch_App2
,Launch_Mail,Launch_Media,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19,F20,F21,F22
,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
,²,&,é,",',(,-,è,_,ç,à,),=,$,£,ù,*,~,#,{,[,|,``,\,^,@,],},;,:,!,?,.,/,§,<,>,vkBC
   Loop,Parse,keys, `,
      Hotkey, *%A_LoopField%, KeyboardDummyLabel, %state%
   Return
; hotkeys need a label, so give them one that do nothing
KeyboardDummyLabel:
Return
}
Quote:
Keyboard hook method:
Your method is every interesting. If in understand correctly, pressing 3 times Numpad6 will unblock the keyboard?
How did you know that
Code:
if (NumGet(lParam+4) = 0x4D && !(NumGet(lParam+8) & 1))
matches Numpad6? Do you know a generic way to interpret all keys?

Anyway, thanks you for your very interesting answer. I defintevely learn something today.
:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 15th, 2007, 1:25 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
You should add UseErrorLevel to the options. (I get "² is not a valid key name.")

Andreone wrote:
If in understand correctly, pressing 3 times Numpad6 will unblock the keyboard?
Correct. It acts on key up so that a) key-repeat won't trigger it and b) the Numpad6 press and release will both be blocked.
Quote:
How did you know that
Code:
if (NumGet(lParam+4) = 0x4D && !(NumGet(lParam+8) & 1))
matches Numpad6?

The lParam of LowLevelKeyboardProc (the callback for the keyboard hook) is a pointer to a KBDLLHOOKSTRUCT, which is defined as:
Code:
typedef struct {
    DWORD vkCode;
    DWORD scanCode;
    DWORD flags;
    DWORD time;
    ULONG_PTR dwExtraInfo;
} KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;
The scancodes reported by AutoHotkey are a combination of scanCode and the extended key flag. So these would be conceptually equivalent:
Code:
if (NumGet(lParam+4) = 0x4D && !(NumGet(lParam+8) & 1))
if (scanCode = 0x4D && !(flags & LLKHF_EXTENDED))
if (SC = "04D")  ; this value shows in the key history
I used the scanCode of Numpad6 rather than the vkCode so that the state of NumLock wouldn't matter. !(NumGet(lParam+8) & 1) is necessary because 'Numpad6' and 'Right' differ only by the extended flag.
Quote:
Do you know a generic way to interpret all keys?
Unfortunately, there's no quick (automatic) way to convert between the AutoHotkey key name and the sc/vk codes. (It should be fairly easy to write a lookup script, though.)

If you want to hard-code a key, it's easy enough to get the sc or vk code using a KeyHistory script.

Btw, to block only physical keypresses (and allow Send), add this to the function:
Code:
    if (NumGet(lParam+8) & 0x10)  ; LLKHF_INJECTED
        return DllCall("CallNextHookEx", "uint", 0, "int", nCode, "uint", wParam, "uint", lParam)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2007, 1:31 am 
Offline

Joined: April 30th, 2006, 6:23 pm
Posts: 358
Location: Shigle Springs
Andreone wrote:
The following link leads you to script that blocks mouse and keyboard until a hotkey is pressed.
You just have to remove or comment the line with BlockInput MouseMove
http://www.autohotkey.com/forum/viewtopic.php?t=22761

I like this, good work. I am using it to set X amount of time of computer use for my kids before they get locked.. Then they will have to earn more time by doing chores etc, the hotkey will unlock it so they can use it more. I will use settimer or a countdown to activate it based upon a readini or someting!!! :wink: :lol: :shock: :lol:
Q: Is there any way to use goto instead of gosub? I would like to be able to turn it on and off via a hotkey and not have to do an exitapp.

Thank you.

_________________
CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2007, 8:25 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
DeWild1 wrote:
I like this, good work.
Thank you :)
DeWild1 wrote:
Is there any way to use goto instead of gosub?[:quote].
Certainly, but what for? They're pretty close. BTW, where do you see a Gosub in the script?
DeWild1 wrote:
I would like to be able to turn it on and off via a hotkey and not have to do an exitapp.
Do you mean this?
Code:
QUIT_HOTKEY=^Esc
TOGGLE_HOTKEY=!Esc
; ______________________________________________________________________________
;
#Persistent
#NoEnv ; Avoids checking empty variables to see if they are environment variables
Menu,Tray,Icon,shell32.dll,48    ; systray icon is a padlock
; install the quit hotkey
Hotkey,%QUIT_HOTKEY%,ExitSub
Hotkey,%TOGGLE_HOTKEY%,ToggleLockState
return
; ______________________________________________________________________________
;
ExitSub:
ExitApp ; The only way for an OnExit script to terminate itself is to use ExitApp in the OnExit subroutine.

ToggleLockState:
LockState := (LockState == "On" ? "Off" : "On")
ToolTip % LockState
BlockKeyboardInputs(LockState)
BlockMouseClicks(LockState)
if(LockState == "On")
   BlockInput MouseMove
Else
   BlockInput,MouseMoveOff
Return


; ******************************************************************************
; Function:
;    BlockKeyboardInputs(state="On") disables all keyboard key presses,
;   but Control, Shift, Alt (thus a hotkey based on these keys can be used to unblock the keyboard)
;
; Param
;   state [in]: On or Off
;
BlockKeyboardInputs(state = "On")
{
   static keys
   keys=Space,Enter,Tab,Esc,BackSpace,Del,Ins,Home,End,PgDn,PgUp,Up,Down,Left,Right,CtrlBreak,ScrollLock,PrintScreen,CapsLock
,Pause,AppsKey,LWin,LWin,NumLock,Numpad0,Numpad1,Numpad2,Numpad3,Numpad4,Numpad5,Numpad6,Numpad7,Numpad8,Numpad9,NumpadDot
,NumpadDiv,NumpadMult,NumpadAdd,NumpadSub,NumpadEnter,NumpadIns,NumpadEnd,NumpadDown,NumpadPgDn,NumpadLeft,NumpadClear
,NumpadRight,NumpadHome,NumpadUp,NumpadPgUp,NumpadDel,Media_Next,Media_Play_Pause,Media_Prev,Media_Stop,Volume_Down,Volume_Up
,Volume_Mute,Browser_Back,Browser_Favorites,Browser_Home,Browser_Refresh,Browser_Search,Browser_Stop,Launch_App1,Launch_App2
,Launch_Mail,Launch_Media,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19,F20,F21,F22
,1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
,²,&,é,",',(,-,è,_,ç,à,),=,$,£,ù,*,~,#,{,[,|,``,\,^,@,],},;,:,!,?,.,/,§,<,>,vkBC
   Loop,Parse,keys, `,
      Hotkey, *%A_LoopField%, KeyboardDummyLabel, %state% UseErrorLevel
   Return
; hotkeys need a label, so give them one that do nothing
KeyboardDummyLabel:
Return
}

; ******************************************************************************
; Function:
;    BlockMouseClicks(state="On") disables all mouse clicks
;
; Param
;   state [in]: On or Off
;
BlockMouseClicks(state = "On")
{
   static keys="RButton,LButton,MButton,WheelUp,WheelDown"
   Loop,Parse,keys, `,
      Hotkey, *%A_LoopField%, MouseDummyLabel, %state% UseErrorLevel
   Return
; hotkeys need a label, so give them one that do nothing
MouseDummyLabel:
Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2007, 9:23 pm 
Offline

Joined: April 30th, 2006, 6:23 pm
Posts: 358
Location: Shigle Springs
Quote:
ExitApp ; The only way for an OnExit script to terminate itself is to use ExitApp in the OnExit subroutine.

Sorry, it has been a few days after I studied your code, I was going by memory and my memory sucks... :oops: The words "subroutine" confused me...
Wow, I will try your code now.. That simple for you? Wow, :o :shock: 8) , I am jealous.

_________________
CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2007, 9:34 pm 
Offline

Joined: April 30th, 2006, 6:23 pm
Posts: 358
Location: Shigle Springs
WOW! :lol:
Your awesome!
Thank you!
When I get the rest of the code figured out, I will post under scripts..
I can not wait to hear my kids, "DAD, my mouse and keyboard do not work! :P And there is some message on the screen that says do your chores!"

This is fun.. You know, a few days ago, the first time I tried your code, I did not read it, I had to reboot.. I was laughing my ass off.
BTW, With my Tablet laptop, the pen mouse still worked but I could not click on anything..

_________________
CPULOCK.com
virusSWAT.com
Computer Repair Computer Service.com
911PCFIX.com


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, engunneer, Pulover, rbrtryn, sarevok9, Wicked, Yahoo [Bot], Zaelia and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group