alt - shift - ctrl is pressed?

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:

alt - shift - ctrl is pressed?

Post 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
User avatar
KuzKuz
Posts: 611
Joined: Mon Aug 19, 2013 5:12 pm
Location: Ukraine

Re: alt - shift - ctrl is pressed?

Post by KuzKuz »

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

Re: alt - shift - ctrl is pressed?

Post by MehdiZangenehBar »

what about right-click? is it possible?
Post Reply