iOS Question iOS capture Keypress

simonwilliamson

Member
Licensed User
Hi,

Is it possible to capture a keypress on iOS apps? I know it sounds silly but some users will have attached a Bluetooth keyboard and I have created an on-screen numberpad to allow users to enter information. If there isn't, then is there a way to stop the iOS keyboard appearing when a textbox is given focus?

Regards,

Simon
 

Semen Matusovskiy

Well-Known Member
Licensed User
There is enough simple way. You can make a Panel with own 'keyboard' and to assign it to inputView property of TextField / TextView. For example,
B4X:
    Dim p As Panel
    '  add own buttons  
    Dim no As NativeObject = TextField1
    no.SetField ("inputView", p)
When TextField will receive a focus, IOS will show your panel instead of virtual keyboard. As I understand, physical keyboard will work also (at least it's so in Simulator).
 
Upvote 0

simonwilliamson

Member
Licensed User
The above works well thank you but I was wondering if there was a way to also hide the grey undo bar that appears at the bottom when the textfield has focus?



Regards,
Simon.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
After no.SetField ("inputView", p) add
B4X:
Dim item As NativeObject = no.GetField ("inputAssistantItem")
item.SetField ("leadingBarButtonGroups", Null)
item.SetField ("trailingBarButtonGroups", Null)
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…