Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need to disable ctrl + and ctrl -


  • Please log in to reply
4 replies to this topic
NeilA
  • Members
  • 3 posts
  • Last active: Jan 17 2013 02:50 PM
  • Joined: 16 Jan 2013

Newbie here so go easy on me.

 

I've wrote the below script to disable:

  • the use of the F keys
  • the use of the F keys in conjunction with any other key
  • the use of ctrl and w
  • the use of the mouse wheel in conjunction with any other key

What I need to do is disable the ctrl and - key combination plus the ctrl and + key combination.  Can anyone help?

 

#NoTrayIcon

*F1::
Return
*F2::
Return
*F3::
Return
*F4::
Return
*F5::
Return
*F6::
Return
*F7::
Return
*F8::
Return
*F9::
Return
*F10::
Return
*F11::
Return
*F12::
Return

^w::
Return

*WheelUp::
Return
*WheelDown::
Return

 



Seidenweber
  • Moderators
  • 638 posts
  • Last active: Sep 06 2015 01:51 PM
  • Joined: 10 May 2011

maybe this works for you

    #SingleInstance force
    #NoTrayIcon

    DisabledKeys := ["*F1","*F2","*F3","*F4","*F5","*F6","*F7","*F8","*F9","*F10","*F11","*F12","^w","*WheelUp","*WheelDown","^+","^-"]
    Loop % DisabledKeys.MaxIndex()
        Hotkey, % DisabledKeys[A_Index], DoNothing

    Return ; end of autoexec section

    DoNothing:
    Return

Edited by Seidenweber, 19 January 2013 - 09:25 PM.
see Leef_me's post - he's right :)

All questions & answers are related to AHK 1.1.19.03 x64 Unicode

 


Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

Seidenweber>>

maybe this works for you

 

 

When you have a label in a script, >>ALWAYS<< end the routine with a "return".

 

Never assume that a portion of code is at  the end of the script,

and never teach others to rely on the end of script as though there is a 'return'

 

Therefore, Seidenweber's script should end like this

 

 

DoNothing:
return

 

and an even more proper version would prevent execution from 'falling' into DoNothing

 

 

return
 
DoNothing:
return


Seidenweber
  • Moderators
  • 638 posts
  • Last active: Sep 06 2015 01:51 PM
  • Joined: 10 May 2011

for good order's sake - you are right icon_idea.gif


All questions & answers are related to AHK 1.1.19.03 x64 Unicode

 


timothyausten
  • Members
  • 4 posts
  • Last active: Apr 16 2014 01:17 PM
  • Joined: 06 May 2013

This looks good, but I get an error complaining about a square bracket in the variable.

 

 

 

The following variable name contains an illegal character:
"[""