Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Script shortcut

Author
Message
  Topic Search Topic Search
balabuev View Drop Down
Member
Member


Joined: 2013 Dec 19
Online Status: Offline
Posts: 3
Direct Link To This Post Topic: Script shortcut
    Posted: 2013 Dec 19 at 8:36am

User Information:

Cinema 4D Version:   14 
Platform:   Windows  ;   
Language(s):   C.O.F.F.E.E  ;    PYTHON  ; 

---------

If I have a script with multiple shortcuts assigned to it, how can I determine, which shortcut was pressed?

It seems that GetInputState is not available in script code...
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2575
Direct Link To This Post Posted: 2013 Dec 19 at 1:30pm
Hi balabuev,

Reading out the shortcut that was used to invoke a command is not possible. Are you sure you need this
sort of functionality? Altering the behavior of the command depending on the shortcut that was used to
execute it is inconsistent with Cinema 4D (and restricts the user unless you provide a separate place for
the user to define which shortcut invokes which behavior).

Best,
-Niklas
Back to Top
balabuev View Drop Down
Member
Member


Joined: 2013 Dec 19
Online Status: Offline
Posts: 3
Direct Link To This Post Posted: 2013 Dec 19 at 8:50pm
Hi,

I've created simple scripts, which saves editor camera positions, and allows to return to them quickly. So, this is actually a Viewport Bookmarks.

Works like in Delphi:

Ctrl+Shift+1 (2, 3, 4, 5, ...) - set bookmark
Ctrl+1 (2, 3, 4, 5, ...) - goto bookmark

Now they are all separate scripts (similar to each other). I just wanted to combine all them to a single script for convenency.

I understand the inconsistency with basic "command" notion, but here it will be adequate. And moreover, some built-in commands, like Pan and Zoom actually works the same, e.g. having several shortcuts with tricky differences in behavior depending of it.
Back to Top
balabuev View Drop Down
Member
Member


Joined: 2013 Dec 19
Online Status: Offline
Posts: 3
Direct Link To This Post Posted: 2013 Dec 20 at 1:39am
Basically, I've soolved the problem using Python, where c4d.GetInputState() function is available.
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.