// displays an information, if the CapsLock is activated OPT OPTIMIZE MODULE 'devices/input','exec/io','input','devices/inputevent' MODULE 'commodities','libraries/commodities','dos/dos' MODULE 'intuition/intuition','utility/tagitem','intuition/screens','intuition/intuitionbase' DEF InputBase DEF broker=NIL,broker_mp=NIL:PTR TO MP,cxsigflag,CXBase DEF caps_window=NIL:PTR TO Window DEF display_caps=FALSE // if TRUE, then we display the icon PROC main() DEF request=NIL:PTR TO IOStd,port=NIL,msg IF CXBase:=OpenLibrary('commodities.library',37) IF broker_mp:=CreateMsgPort() IF broker:=CxBroker([ NB_VERSION, 'capslock', 'capslock v1.0 by MarK', 'displays icon if CapsLock key pressed.', 0,0,0, broker_mp, 0]:NewBroker,NIL) cxsigflag:=1<scr close_caps_window() // close the window on back screen open_caps_window() // open the window on the front screen ENDIF ENDIF ENDPROC PROC close_caps_window() IF caps_window THEN CloseWindow(caps_window) caps_window:=NIL ENDPROC PROC get_front_screen()(PTR TO Screen) DEF scr:PTR TO Screen scr:=IntuitionBase::IntuitionBase.ActiveWindow.WScreen ENDPROC scr