See TCommonCustomForm.KeyDown for more information about parameters. Override the protected KeyDown method to provide other responses when a key is down while the control has keyboard input focus. If the control has successfully processed the pressed key combination and no additional processing is required, then KeyDown assigns Key = 0 and Ke圜har = #0. Indicates which shift keys-SHIFT, CTRL, ALT, and CMD (only for Mac)-were down when the specified key was pressed with the control in focus. Editors can use this symbol to add into a text being edited. But it seems, that there is absolute no solution, orHow to get the correct Cursor-position in TEdit, evensome Text is selectedI've got 3 answers for my postings yesterday.All telling me to use SelStart or this. If a pressed key combination can be treated as a printable character or digit, then Key = 0 and Ke圜har contains a pressed symbol according to the current keyboard's input language, keyboard mode (CAPS LOCK and NUM LOCK keys), keyboard Shift state, and IME state. Immediate caret positioning on mouseclick Automatic sorting when column headers are clicked with several sort methods and customizations. Delphi Tedit Set Caret Position Hi to all,sorry, here I am with same question again. VkReturn = $0D corresponds to the F2 keyboard key.
If you google for it you will find lots of hits that tell you to do the following: Memo1.SelStart : Memo1.Perform (EMLINEINDEX, Line, 0) But that looks to be at least pre-Delphi 2007.
Platform-specific units (for example ) should translate native scan codes to corresponding Windows codes defined in the UITypes unit. Once in a while you want to set the caret position (aka cursor position) in a TMemo to a given line and character in that line. Physical scan codes of the same key can differ under different platforms (Windows or iOS). If a pressed key combination can be a shortcut, then Key 0 is a virtual key and Ke圜har = #0.
Is the scan code of the pressed keyboard key or $0. They pass them into the called KeyDown method in the Key, Ke圜har, and Shift parameters, respectively: They decode the message parameters into the key code, character code, and shift state. TCommonCustomForm and descendant of TControl classes-like TCustomGrid-call KeyDown from their methods handling key pressing. Otherwise, KeyDown calls the OnKeyDown event handler if one is assigned. If the pressed key is the Applications key ( Key = vkApps), then KeyDown shows the context menu of the control.
Provides a response when a key is pressed down while the control has the keyboard focus.įMX. inherits from.