Close
Showing results 1 to 10 of 41

Hybrid View

  1. #1

    Default

    Quote Originally Posted by Freddie View Post
    I think I know what's wrong but I haven't figured out what to do about it.

    I think it's just that when you Alt Tab, by the time you release the Alt key, WoW is no longer the focus window, so Mojo never broadcasts the release of the Alt key.

    As a result, Mojo's key state tables (the fake ones it maintains for each WoW) show the Alt key down. Then next time you broadcast a key, Mojo translates the key with the screwed up key state tables. This could have odd effects since the operating system has a complicated way of interpreting keystrokes when Alt is down.
    What about marking all keys as released (and sending the relevant key up events) when the focused window changes?

  2. #2

    Default

    Quote Originally Posted by TheFallenOne View Post
    What about marking all keys as released (and sending the relevant key up events) when the focused window changes?
    My first thought was along similar lines. But there are some complications and I'm not sure how to deal with them.

    The first question is, What triggers Mojo to act? You suggest the trigger should be a change in the focus window. But how can Mojo know that the focus window changes? The only way I can think of is for Mojo to install an OS hook of some kind, probably a WH_SHELL hook. This might slow the computer down appreciably. I don't know, it would require testing. If somebody can think of a different way please tell me.

    Second, what action does Mojo take? The suggestion is, tell every broadcast target that modifiers are up. I think there would need to be some conditional restrictions on this because the user might not want that to happen. To take an extreme example, the program is going to allow people to write a hotkey like this:

    Code:
    Hotkey ( F1 )
    {
       SendTo ( WoW1 )
          PressKey ( Alt );
    }
    That basically means, "Make the target program think Alt is pressed and let it keep thinking that until I say so."

    I can't foresee why somebody would write that, but it's legal given the program's syntax so part of my job is to ensure that it works and avoid automatic actions that interfere with the user's intent.
    Last edited by Freddie : 01-18-2010 at 03:40 PM
    �Author of HotkeyNet and Mojo

Posting Rules

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