-- 1. Define the event function
function CheckListBox1KeyDown(sender, key)
-- Check if the pressed key is the Enter key (VK_RETURN)
if key == VK_RETURN then
print("Enter key was pressed!")
-- Run your custom logic here
myCustomFunction()
-- Return 0 to prevent the key from triggering default Windows behaviors
return 0
end
-- Return the original key for any other button presses
return key
end
-- 2. Bind the function to your UI element
-- (Replace 'CETrainer.CheckListBox1' with your actual form and element names)
CETrainer.CheckListBox1.OnKeyDown = CheckListBox1KeyDown
-- Your custom function to execute
function myCustomFunction()
print("Executing custom action...")
end
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum