Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkeyIOSOSXWindows

List Of All Virtual Key Codes For OnKeyDown And OnKeyUp In Delphi XE6 Firemonkey On Android And IOS

Delphi XE6 Firemonkey Virtual Key CodesIf you are building any kind of cross platform app where you use the keyboard you will probably need to know the various virtual key code constants which are listed in the System.UITypes unit in Delphi XE6 Firemonkey. These key codes also apply to Delphi XE5 and AppMethod. Keys like the hardware back button on your Android device are listed here as well as arrow keys and the like. You can compare the virtual key code that you want to the Key parameter in the OnKeyUp and OnKeyDown events of each control. Keep in mind that there is also the OnTyping event which is fired on IOS in addition to the usual OnKeyUp and OnKeyDown events. If your OnKeyUp and OnKeyDown events are not working for you on IOS try OnTyping instead. To use the virtual key codes you can set up a case statement on the Key parameter on OnKeyUp and OnKeyDown. You can cancel out a key press by setting the Key parameter to 0. Also keep in mind that there is a second parameter called KeyChar in the OnKeyUp and OnKeyDown events. I have had good success with the following code (on Windows at least):

Head over and check out the full list of virtual key codes on Embarcadero’s webiste for use with Delphi XE6 Firemonkey.


Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes


Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores


DelphiCon 2020 FireMonkey Sessions Available Starting November 19


Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

Leave a Reply