Keep Controls Visible When Virtual Keyboard Opens In Delphi XE8 Firemonkey On Android

Delphi XE8 Firemonkey Scroll Form When Keyboard Visible AndroidOver on the QDAC blog there is a solution for keeping controls visible when the virtual keyboard is shown on Delphi XE8 Firemonkey. The code is not perfect and it has only been tested on Android and not IOS but it is an automated solution as you simply add the unit to the uses clause and it works. There are multiple other solutions which we’ve talked about before for Delphi XE5 but they require implementing code in each form. This new unit for Delphi XE8 implements three different steps which are: a subscription to TVKStateChangeMessage, a timer every 100ms to check for a state change of the keyboard, and calling an event if the keyboard state changes. The original blog post is in Chinese so you’ll need to use a translator. This solution should also work with Appmethod.

Head over and check out the full blog post for the automated scrollable form virtual keyboard solution for Delphi XE8 Firemonkey and then download the source.

Mirror: Download the virtual keyboard helper unit.

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

9 Responses to Keep Controls Visible When Virtual Keyboard Opens In Delphi XE8 Firemonkey On Android

  1. swish says:

    I have update this unit in 2016.1.8.Please update the mirror.The new release fixed a bug in special action.
    The new version for users out of china,I just share it in

    • Malcolm says:

      I see there may be later versions. Will you share them?

      But I see the following issue with all the solutions. On a clean launch of an app, if the very first TEdit entered (tapped) needs a scroll then no scrolling takes place. Closing the VKbd then entering the TEdit again does cause a scroll.
      If the first TEdit entered does not need a scroll then the first one needing a scroll afterwards does scroll.
      So it seems that some initialization is needed before the first invocation of the VKbd (?)

      • swish says:

        The last version is update in 2016.7.29 and fixed all known errors.Now it is a part of QDAC 3.0,so if you checkout from svn:// , you will found it in the Source directory.
        Changes from 2016.1.8:
        * Fixed:Access volation when you set control return action to Next and the control is the last one
        * Fixed:Segment fatal in special devices because scrollbox adjust render
        * Optimize the speed when add the adjust layout

        * Fixed:Adjust is overload in specail scene
        * Fixed:Form fill style is working correct

        * Fixed:When FLastControl is removed ,FLastControl not set to nil

        * Add Fix for system iOS virtualkeyboard error,detail see: (Chinese)

        * Add support for automic change focus control when you set edit ReturnKeyType to Next(You can disable it by set EnableReturnKeyHook to false

        * rewrite the adjust code for speed and other bug fix
        * rename to qdac_fmx_vkhelper
        + Add support for iOS

        + Add support for TMemo

        * Remove the timer for fast response(Use Idle message replace)
        * Fix a bug when a focus control reshow virtualkeyboard(Thanks 似水流年)
        * Fix a bug when use hide virtual keyboard by use hardware back key(Thanks 阿笨猫)
        * Fix a FMX bug :after virtual keyboard shown,can’t use hardware back key to exit app

  2. Pingback: Keep Controls Visible When Virtual Keyboard Pops Up In Delphi 10.2 Tokyo On Android And IOS | Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Tokyo Firemonkey, Delphi Android, Delphi IOS

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Material Design Ripple Click Effect Demo In #Delphi XE8 Firemonkey On #Android And #IOS

One of the new material design effects which is found in Android Lollipop is the Ripple Click Effect. This effect...