Results 1 to 5 of 5

Thread: Identify UI button's "command" programmatically?

  1. #1
    Electron wrangler jwiede's Avatar
    Join Date
    Aug 2007
    Location
    San Jose, CA
    Posts
    6,485

    Identify UI button's "command" programmatically?

    Is there any way, given an arbitrary UI button*'s label text, or GUI entity's pointer/handle, to programmatically determine the command it triggers? Only care about the main UI buttons managed by the Menu Editor, not asking about any/all arbitrary UI controls. Oh, and asking w.r.t. LW2015 (and prior, ideally), LW2018-only approaches aren't useful for my needs.

    Parsing config file contents won't work because "default" assignments don't show up in there.
    John W.
    LW2015.3UB/2018.0.7 on MacPro(12C/24T/10.13.6),32GB RAM, NV 980ti

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,891
    In Layout there is Utilities > Cmd History.. You can make your own using Layout Master. event() will be called each time command is passing through queue.

    determine the command it triggers?
    Who said so there will be any command triggered?

    Is there any way, given an arbitrary UI button*'s label text, or GUI entity's pointer/handle,
    I have used this several times (not in LW): make screen-shot, then cut buttons you're interested in, store them somewhere, with info what they mean to you.
    Then in app which is interested in which button has been pressed,
    take screen-shots often, and compare area below mouse pointer, with stored data.
    It's possible to accelerate it with hashes, instead of comparing pixel-by-pixel.

  3. #3
    Electron wrangler jwiede's Avatar
    Join Date
    Aug 2007
    Location
    San Jose, CA
    Posts
    6,485
    Quote Originally Posted by Sensei View Post
    In Layout there is Utilities > Cmd History.. You can make your own using Layout Master. event() will be called each time command is passing through queue.
    Not quite what I'm looking for, as it requires the button actually be pressed. What I'm trying to do relies on hover, not press.

    Quote Originally Posted by Sensei View Post
    Who said so there will be any command triggered?
    If there isn't any command assigned to the button, so be it (ideally I'd want a null string or such in that case).

    Quote Originally Posted by Sensei View Post
    I have used this several times (not in LW): make screen-shot, then cut buttons you're interested in, store them somewhere, with info what they mean to you.
    Then in app which is interested in which button has been pressed,
    take screen-shots often, and compare area below mouse pointer, with stored data.
    It's possible to accelerate it with hashes, instead of comparing pixel-by-pixel.
    I can always hash off entity label and possibly entity handle, if needed -- semantically similar to what you're doing with img compare, but that doesn't really help for users customizing existing buttons' associated commands, nor for user-created buttons. Oh well, pain is life, yadda yadda yadda.

    Thanks for the help!
    Last edited by jwiede; 02-07-2018 at 08:22 PM.
    John W.
    LW2015.3UB/2018.0.7 on MacPro(12C/24T/10.13.6),32GB RAM, NV 980ti

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,891
    Such tricks are usually used for automation of what user wanted.
    He/she press "Learn", then start clicking, then "Stop Learning". And then task can be repeated over and over again.
    And user is just watching how computer moves mouse, presses/releases buttons.
    Automation, even in applications not designed with proper commands with arguments and built-in scripting language.
    Last edited by Sensei; 02-07-2018 at 08:57 PM.

  5. #5
    Electron wrangler jwiede's Avatar
    Join Date
    Aug 2007
    Location
    San Jose, CA
    Posts
    6,485
    Quote Originally Posted by Sensei View Post
    Such tricks are usually used for automation of what user wanted.
    He/she press "Learn", then start clicking, then "Stop Learning". And then task can be repeated over and over again.
    And user is just watching how computer moves mouse, presses/releases buttons.
    Automation, even in applications not designed with proper commands with arguments and built-in scripting language.
    Understood. Not quite what I'm doing in this case, though.

    I was pretty sure there was no programmatic approach for it, just wanted to ask around to be sure there wasn't some obscure trick for it (well, less obscure than what we're describing, anyway). I have a couple backup plans for how to deal with user-created/-modified buttons, just had hopes they might not be needed.

    Thanks for the help!
    John W.
    LW2015.3UB/2018.0.7 on MacPro(12C/24T/10.13.6),32GB RAM, NV 980ti

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •