Menu

#72 hwg_GetKeyboardState() and hwg_GetKeyState()

v1.0_(example)
open
nobody
None
1
2023-12-19
2023-12-17
No

Hi!
I look into /gtk/misc.c and found the function hwg_GetKeyboardStatus()
If I'm not mistaken, it seems to me that this function doesn't work(hwg_GetKeyboardStatus)
Becouse in windows(OS) I use hwg_GetKeyState(VK_DELETE) > 0 and works
On GTK exists any similar ?

Best regards,
Itamar M. Lins Jr.

Discussion

  • Alexander S.Kresin

    I wonder, who and why added the function hwg_GetKeyState() to gtk, because it's code has no any relation to a keyboard. There is no similar function in gtk.
    The hwg_GetKeyboardStatus() is used to determine, if ctrl, shift and alt are pressed, and may be used in event handler only, see the hcedit.prg for example.

    Regards, Alexander

     
    • Itamar M. Lins Jr.

      Hi!
      I need detec the exit of a GET element.
      because a user can exit get by pressing key esc.
      And this way I know that he canceled the get edit.
      for exemple:
      A get in editing of BROWSE open another browse for search.
      Function ValidMyGetOfBrowse()
      if key ESC
      else
      oGet := value := MyFunctionBrowseElementsToChoose() //->equivalent to combobox
      endif

      Becouse only ON FOCUS and LOST FOCUS do not resolve this situation.

      If there is a better way to solve this in Linux, I will adopt it.

      Best regards,
      Itamar M. Lins Jr.

       
  • Alexander S.Kresin

    You don't need this, because your bValid isn't called and a field isn't updated if ESC was pressed,
    Look at hbrowse.prg, VldBrwEdit() - a function, which is used as a VALID for a GET.

    Regards, Alexander.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.