TCompoBox - KeyPress lazarus / 31-LCL ---------------------------------------------------------------------- kogs · 2014-02-23 12:04 Aphasia - http://en.wikipedia.org/wiki/Aphasia procedure TfrmMain.cbxAssKeyPress(Sender: TObject; var Key: char); begin   ShowMessage('0 -' + IntToStr(Integer(key)));   if key = #13 then   begin     if VK_SHIFT <> 0 then     begin       ShowMessage('1');       SelectNext(Sender as TWinControl, False, True);     end     else     begin       ShowMessage('2');       SelectNext(Sender as TWinControl, True, True);       key := #0;     end;   end; end;                      ShowMessage('0 -' + IntToStr(Integer(key))) - yes, ShowMessage('1'), ShowMessage('2') - no kogs ---------------------------------------------------------------------- kogs · 2014-02-23 12:07 Mac OS X 9.1 kogs ---------------------------------------------------------------------- Cyrax · 2014-02-23 13:48 Use OnKeyDown method so you can check state of shift and control keys. Code: [Select]procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;   Shift: TShiftState); begin   if ssShift in Shift then; end; ---------------------------------------------------------------------- Bart · 2014-02-23 14:03 This Code: [Select]  if VK_SHIFT <> 0 then will always evaluate to TRUE, because VK_SHIFT is a constant, and it's value is not 0. Bart ---------------------------------------------------------------------- kogs · 2014-02-24 10:45 Quote from: Cyrax on February 23, 2014, 02:48:50 pmCode: [Select]procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;   Shift: TShiftState); begin   if ssShift in Shift then; end; procedure TForm1.ComboBox1KeyDown(Sender: TObject; var Key: Word;   Shift: TShiftState); begin     if Key = VK_RIGHT then   begin     Key := $0;      ... ok