Modify Command Behavior With Key Held Down
All  1  2-8

Previous
Next
 From:  Michael Gibson
12080.2 In reply to 12080.1 
Hi Frederick,

re:
> For example, could the line command use one of those keys to determine
> if the line is drawn in both directions from the starting point.

It is possible for a command to check if the control key was down when the point pick was finished.

There isn't currently a way for it to be checked on every mouse move though, just when it is done.

I've attached a modified version of the regular line command that will do a "both sides" line if the control key was held down for the 2nd point pick.

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
12080.3 In reply to 12080.2 
Hi Michael,

Thanks for the example.

Do you think this ability is generally worth incorporating into v5

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
12080.4 In reply to 12080.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
12080.5 In reply to 12080.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:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
12080.6 In reply to 12080.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
12080.7 In reply to 12080.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  fcwilt
12080.8 In reply to 12080.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-8