Keyboard - Mouse events not working

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
MehdiZangenehBar
Posts: 114
Joined: Wed Feb 07, 2024 7:17 pm
Contact:

Keyboard - Mouse events not working

Post by MehdiZangenehBar »

Except for the "OnKeyDown" in some cases (pressing f key), none of the following events works, why?

Code: Select all

-- **************************************************
-- General information about this script
-- **************************************************

ScriptName = "Test_Script"

Test_Script = {}

function Test_Script:Name()
	return 'Test Script'
end

function Test_Script:Version()
	return '1.0'
end

function Test_Script:UILabel()
	return 'Test Script'
end

function Test_Script:Creator()
	return 'Test'
end

function Test_Script:Description()
	return 'Test'
end

-- **************************************************
-- Is Relevant / Is Enabled
-- **************************************************

function Test_Script:IsRelevant(moho)
	return true
end

function Test_Script:IsEnabled(moho)
	return true
end

-- **************************************************
-- Events
-- **************************************************

function Test_Script:OnMouseDown(moho, mouseEvent)
	print('Test_Script:OnMouseDown')
end

function Test_Script:OnMouseUp(moho, mouseEvent)
	print('Test_Script:OnMouseUp')
end

function Test_Script:OnKeyDown(moho, keyEvent)
	print('Test_Script:OnKeyDown')
end

function Test_Script:OnKeyUp(moho, keyEvent)
	print('Test_Script:OnKeyUp')
end

function Test_Script:OnInputDeviceEvent(moho, deviceEvent)
	print('Test_Script:OnInputDeviceEvent')
end
User avatar
synthsin75
Posts: 10267
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Keyboard - Mouse events not working

Post by synthsin75 »

Shortcut keys do not get passed to scripts.

OnKeyUp not working probably has something to do with the momentary tool selection (tool selected while you hold the shortcut, and then back to the last tool when you release it).
User avatar
MehdiZangenehBar
Posts: 114
Joined: Wed Feb 07, 2024 7:17 pm
Contact:

Re: Keyboard - Mouse events not working

Post by MehdiZangenehBar »

So the only trigger is Alt?
Post Reply