Use load command

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
davoodice2
Posts: 381
Joined: Tue Jun 15, 2021 1:14 pm

Use load command

Post by davoodice2 »

Hello friends
Can i do this?

Code: Select all

Local a= "mouseEvent.shiftKey"
If(a) then
...

End
I find some thing like load command in lua so

Code: Select all

Local a= "mouseEvent.shiftKey"
If(load(a)) then
...

End
But this didnt work
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
User avatar
hayasidist
Posts: 3557
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Use load command

Post by hayasidist »

mouseEvent.shiftKey is a boolean...

so if you want to check if the shift key is down it's

if mouseEvent.shiftKey then
-- code if shift is pressed
else
-- code if not shift
end
User avatar
davoodice2
Posts: 381
Joined: Tue Jun 15, 2021 1:14 pm

Re: Use load command

Post by davoodice2 »

hayasidist wrote: Tue Nov 16, 2021 9:11 am mouseEvent.shiftKey is a boolean...

so if you want to check if the shift key is down it's

if mouseEvent.shiftKey then
-- code if shift is pressed
else
-- code if not shift
end
thanks
NO my goal isn't check shift key. I want change shift to alt for example and it applie to all script. actually i want store mouseEvent.shiftkey into variable,and i change variable instead of mouseEvent.shift
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
User avatar
synthsin75
Posts: 10007
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Use load command

Post by synthsin75 »

Well, you could do mouseEvent.shiftKey = mouseEvent.altKey, but then you'd lose access to the shift key.

I don't understand what you're trying to do.
User avatar
hayasidist
Posts: 3557
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Use load command

Post by hayasidist »

davoodice2 wrote: Tue Nov 16, 2021 9:59 am NO my goal isn't check shift key. I want change shift to alt for example and it applie to all script. actually i want store mouseEvent.shiftkey into variable,and i change variable instead of mouseEvent.shift

you mean you want all scripts - including "factory" ones to react as though (e.g.) shift was pressed when the user actually pressed alt ???
User avatar
synthsin75
Posts: 10007
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Use load command

Post by synthsin75 »

hayasidist wrote: Tue Nov 16, 2021 8:29 pm you mean you want all scripts - including "factory" ones to react as though (e.g.) shift was pressed when the user actually pressed alt ???
If so, that would sound like a use for AutoHotkey, if on Windows.
Post Reply