[Gambas-user] Re: Some Captured, Some Not

A Person kztyrvlq at ...966...
Mon Jan 9 01:47:25 CET 2006


Sorry, cannot send project but can send the applicable sub.

Hope this helps somewhat. This code was written before I knew about the 
constants such as Key.Home (today!).

Specifically, IF #1 (HOME), ELSE IF #2 (END), ELSE IF #5 (PAGE UP) and 
ELSE IF #6 (PAGE DOWN) bypass this event.

I checked the values and all are OK but this is a red herring since no 
entry into the subroutine exists.

. . .
PUBLIC SUB lblWords_Keypress()

   ' home key
   'IF Key.Code = 4112 THEN
   IF Key.Code = Key.Home THEN
     IF iLineNumWords <> 0 THEN
       iLineNumWords =  0
       srTagLine
       lblWords.Refresh
     END IF
   ' end key
   ELSE IF Key.Code = 4113 THEN
     IF iLineNumWords <> iNumTagLine - 1 THEN
       iLineNumWords = iNumTagLine - 1
       srTagLine
       lblWords.Refresh
     END IF
   ' left arrow key and up arrow key
   ELSE IF Key.Code = 4114 OR Key.Code = 4115 THEN
     IF iLineNumWords - 1 >= 0 THEN
       iLineNumWords = iLineNumWords - 1
       srTagLine
       lblWords.Refresh
     END IF
   ' right arrow key and down arrow key
   ELSE IF Key.Code = 4116 OR Key.Code = 4117 THEN
     IF iLineNumWords + 1 <= iNumTagLine - 1 THEN
       iLineNumWords = iLineNumWords + 1
       srTagLine
       lblWords.Refresh
     END IF
   ' page up key
   ELSE IF Key.Code = 4118 THEN
     IF iLineNumWords - Abs(iNumTagLine / 100) >= 0 THEN
       iLineNumWords = iLineNumWords - Abs(iNumTagLine / 100)
       srTagLine
       lblWords.Refresh
     END IF
   ' page down key
   ELSE IF Key.Code = 4119 THEN
     IF iLineNumWords + Abs(iNumTagLine / 100) <= iNumTagLine - 1 THEN
       iLineNumWords = iLineNumWords + Abs(iNumTagLine / 100)
       srTagLine
       lblWords.Refresh
     END IF
   END IF
END
. . .

Thanks

Paul





More information about the User mailing list