Page 1 of 1

does KSET* Keyborad Function work in Background ?

Posted: Thu Nov 11, 2021 8:24 am
by AUGE_OHR
hi,

i have create a TIMER

Code: Select all

   DEFINE TIMER Timer_1 OF KbStatus INTERVAL 300 ACTION DoUpdateImage()
which does show Status of Keyboard

Code: Select all

PROCEDURE DoUpdateImage()
   IF KSETNUM()
      KbStatus.Image_1.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_1.PICTURE := "KBRED"
   ENDIF
   IF KSETCAPS()
      KbStatus.Image_2.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_2.PICTURE := "KBRED"
   ENDIF
   IF KSETINS()
      KbStatus.Image_3.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_3.PICTURE := "KBRED"
   ENDIF
RETURN
that work perfect ... when App have Focus !
why does it not work in Background :?:

i can "see" NumLock of Statusbar is working in Background
so what do i miss :idea:

p.s. under Windows 11 DEV 10.0.22499.1000 LED of "NUM","CAPS" and "INSERT" does still not work which confuse me
so i need a small App just to "show" "NUM","CAPS" and "INSERT" Status

Re: does KSET* Keyborad Function work in Background ?

Posted: Thu Nov 11, 2021 11:39 am
by edk
Try:

Code: Select all

PROCEDURE DoUpdateImage()
   IF IsNumLockActive()
      KbStatus.Image_1.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_1.PICTURE := "KBRED"
   ENDIF
   IF IsCapsLockActive()
      KbStatus.Image_2.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_2.PICTURE := "KBRED"
   ENDIF
   IF IsInsertActive()
      KbStatus.Image_3.PICTURE := "KBGREEN"
   ELSE
      KbStatus.Image_3.PICTURE := "KBRED"
   ENDIF
RETURN