# Disabling a function when cursor is in input text box?

**URL:** <https://forum.kirupa.com/t/disabling-a-function-when-cursor-is-in-input-text-box/196993>\
**Category:** flash\
**Created:** [August 12, 2006, 1:51pm UTC](https://forum.kirupa.com/t/disabling-a-function-when-cursor-is-in-input-text-box/196993 "2006-08-12T13:51:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al6200](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Al6200](https://forum.kirupa.com/u/Al6200)\
**Post date:** [August 12, 2006, 1:51pm UTC](https://forum.kirupa.com/t/disabling-a-function-when-cursor-is-in-input-text-box/196993/1 "2006-08-12T13:51:52Z")

</div>

For my application, I want the hotkeys to go offline when the user clicks is using the input text box.

I tried using an if conditional so that the hotkeys stop working when the mouse is in the proximity of the textbox, but I think it would be better to have the function disabled when the user is typing in the textbox.

I tried using

inputbox.onSetFocus = function() {  
enable = true;  
}  
inputbox.onKillFocus = function() {  
enable = false;  
}

What should I be using?
