Page 1 of 1

alt - shift - ctrl is pressed?

Posted: Wed May 29, 2024 5:15 pm
by MehdiZangenehBar
How we can detect if user clicked on button while (alt or shift or ctrl) pressed?

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

-- **************************************************
-- Tool Panel Layout
-- **************************************************

Test_Script.BUTTON_1 = MOHO.MSG_BASE

function Test_Script:DoLayout(moho, layout)
	self.button1Button = LM.GUI.Button('Button 1', self.BUTTON_1)
	layout:AddChild(self.button1Button, LM.GUI.ALIGN_LEFT, 0)
end

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

function Test_Script:OnMouseDown(moho, mouseEvent)
end

function Test_Script:HandleMessage(moho, view, msg)
	if msg == self.BUTTON_1 then
		print('Message BUTTON_1 received')
	else
		
	end
end

Re: alt - shift - ctrl is pressed?

Posted: Wed May 29, 2024 6:54 pm
by KuzKuz

Re: alt - shift - ctrl is pressed?

Posted: Wed May 29, 2024 10:46 pm
by MehdiZangenehBar
what about right-click? is it possible?