Navigation: ABC Library Reference > EntryLocatorClass > EntryLocatorClass Methods >====== TakeKey (process an alerted keystroke:EntryLocatorClass) ====== | |
TakeKey, DERIVED
The TakeKey method processes an alerted keystroke for the LIST control that displays the data to be searched and returns a value indicating whether the browse list display should change.
By default, all alphanumeric keys are alerted for LIST controls.
Implementation:
The BrowseClass.TakeKey method calls the locator TakeKey method. The TakeKey method stuffs the keystroke detected by the LIST into the locator's input control and returns zero (0 or False).
Return Data Type: BYTE
Example:
MyBrowseClass.TakeKey PROCEDURE
CODE
IF RECORDS(SELF.ListQueue)
CASE KEYCODE()
OF InsertKey ;!handle insert
OF DeleteKey ;!handle delete
OF CtrlEnter ;!handle enter (change/select)
OF MouseLeft2 ;!handle double-click (change/select)
ELSE
DO CheckLocator !handle all other keystrokes
END
END
RETURN 0
CheckLocator ROUTINE
IF ~(SELF.Sort.Locator &= NULL)
IF SELF.Sort.Locator.TakeKey() !add keystroke to locator input control
SELF.Reset(SELF.GetFreeElementPosition()) !and refresh browse if necessary
SELF.ResetQueue(Reset:Done)
DO HandledOut
ELSE
IF RECORDS(SELF.ListQueue)
DO HandledOut
END
END
END
HandledOut ROUTINE
SELF.UpdateWindow
SELF.PostNewSelection
RETURN 1
See Also: BrowseClass.TakeKey