does KSET* Keyborad Function work in Background ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

does KSET* Keyborad Function work in Background ?

Post 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
have fun
Jimmy
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: does KSET* Keyborad Function work in Background ?

Post 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
Post Reply