Jump to content

How to disable a key


Recommended Posts

i want to make a script to disable the enter button. and probally a few other keys.

winwaitactive("notepad.exe")

sleep(500)

i type here and before i begin a new line by pressing enter i need to know the command that will disable the enter key AND trigger other things to happen such as send("hello!!")

i been looking through the help file didint really see anything that would let me do this like stopkey("{enter}") or disablekey("{enter}") ect

also for when the enter key is pressed i want it to do something like

(if) enter is pressed (then) send("hello!!")

somethin like that

:whistle:

Link to comment
Share on other sites

HotKeySet ( "{ENTER}", "pressed")

Func pressed()

;Your code here... I assume if you leave this blank then the key will not do anything i.e. disabled

EndFunc

Should work.

Edit: someone beat me to it, and I forgot the while loop.

Edited by brodie28
Link to comment
Share on other sites

HI,

if you want to do something by keypress look as mentioned above at HotKeySet. Another possibility is _isPressed() func.

For disabling a key just call a func by hotkey and do nothing in it. :whistle:

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

i want to make a script to disable the enter button. and probally a few other keys.

winwaitactive("notepad.exe")

sleep(500)

i type here and before i begin a new line by pressing enter i need to know the command that will disable the enter key AND trigger other things to happen such as send("hello!!")

i been looking through the help file didint really see anything that would let me do this like stopkey("{enter}") or disablekey("{enter}") ect

also for when the enter key is pressed i want it to do something like

(if) enter is pressed (then) send("hello!!")

somethin like that

:)

A fast and dirty one

HotkeySet("{ENTER}"), "TrapEnter"); Read Help file, for in that there is more info

winwaitactive("notepad.exe")

sleep(500)

;What ever you want to Type  :) 


Func TrapEnter()
Send("Hello")
EndFunc

Dam... im to slow, in the time i was to write my answ. 3 answ. already came :) , hmm need to speed up my typing :whistle:

Edited by Rex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...