MoI discussion forum
MoI discussion forum

Full Version: Modify Command Behavior With Key Held Down

Show messages: All  1-3  4-8

From: fcwilt
15 Aug   [#4] In reply to [#2]
Hi,

Tried you code and it worked fine.

I was thinking that it might be able to check/uncheck the "Both Sides" box (and similar things) in the dialog by using/not using a key

Cannot be done?

Frederick
From: Michael Gibson
15 Aug   [#5] In reply to [#4]
Hi Frederick,

re:
> I was thinking that it might be able to check/uncheck the "Both Sides" box (and
> similar things) in the dialog by using/not using a key
>
> Cannot be done?

A command can register a shortcut key and then do something when that key is pressed. See attached example where typing the B key works the same as clicking on "Both sides".

But it works like other shortcut keys under Options > Shortcut keys, you can't do something when the key is pressed and something different when the key is released.

- Michael

Attachments:
Line.js


From: fcwilt
15 Aug   [#6] In reply to [#5]
Hi Michael,

So when the dialog is first display there is no point at which the state of the control/shift/alt key can be detected and check (or uncheck) a checkbox that is part of the dialog?

Thanks.

Frederick
From: Michael Gibson
15 Aug   [#7] In reply to [#6]
Hi Frederick,

re:
> So when the dialog is first display there is no point at which the state of the
> control/shift/alt key can be detected and check (or uncheck) a checkbox that
> is part of the dialog?

Nope, not from script.

- Michael
From: fcwilt
15 Aug   [#8] In reply to [#7]
Hi Michael.

Understood about the limitation of script.

I was thinking of my general windows programming tool and all mouse events report the state of the mouse buttons AND control/shift/alt.

Frederick

Show messages: All  1-3  4-8