HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: GUIBaseWindow and focus  (Read 2328 times)

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
GUIBaseWindow and focus
« on: Jun 16, 14, 02:48:02 PM »

What is the easiest way to determine if a GUIBaseWindow or any of its children currently has mouse focus?
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: GUIBaseWindow and focus
« Reply #1 on: Jun 16, 14, 03:19:50 PM »

Code: [Select]
// returns a noderef to the GUI node that currently has keyboard focus, if any.
external function GetKeyboardFocus() as NodeRef
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: GUIBaseWindow and focus
« Reply #2 on: Jun 16, 14, 03:26:14 PM »

Hmm, i think this works only with text input...
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: GUIBaseWindow and focus
« Reply #3 on: Jun 16, 14, 07:38:18 PM »

I assumed that is what you meant by focus. What exactly do you mean by "mouse focus"?

Do you mean which control the cursor is currently over?  Because then you would use
Code: [Select]
external function GetGUIControlUnderMouse() as NodeRef
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: GUIBaseWindow and focus
« Reply #4 on: Jun 17, 14, 12:31:13 AM »

I managed to do what i wanted with GetGUIControlUnderMouse() and then looping through returned control parents and checking if one of the parents is a window that i am interested in.

Thanks Scott
Logged