windows - Accepting input while out of focus -


i've never actual asked question on stack overflow, though every programming question i've ever had found answer here. sadly today not 1 of days.

i've spent day googling, browsing win32 api, , trying sorts of things, can't find damn answer i'm looking for.

here's situation: i've got unity project i've created, uses input joystick, there other components project outside of unity, that's irrelevant, base of problem this: how can make application continue accept input while it's out of focus/inactive.

i know fact can done because borderlands 2 can (i found out yesterday when first started trying find answer, aggravating because proves there way, , i'm failing find it).

at least if knows how mouse or keyboard, helpful enough allow me figure out how apply joystick.

some helpful details: i'm avid , experienced programmer, , i've been coding in: c/c++, c#, java, , number of scripting languages many years. hobby, job, in spare time, while i'm asleep...

things i've done / tried:

  • using setfocus + setactive user32 & passing null window losing focus
  • adding wm_killfocus ignore list of other window want read input while in background
  • using sendmessage trick other window reading input
  • overriding inputstream of application (but useless sense couldn't figure out how send joystick input on stream, , because still didn't solve problem sense if other application out of focus (i.e. open notepad), input stop.

  • i searched way make unity standalone game/project/application accept input while in background, yielded nothing.

i don't know if there unity-related solution, can use rawinput api receive events directly mouse/joystick/hid hardware regardless of whether app in focus or not.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -