Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA
Accepted Solution

Custom Keyboard?

[ Edited ]

Is there a way to stop the keyboard from allowing the user to type symbols. I do not want them to be able to use characters such as:

 

/ + - = etc.

 

Thanks

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Custom Keyboard?

[ Edited ]

Other than replacing them after they were typed I think that's not possible.

 

I prefer a post-validation approach until there's a better filtering API: i.e. let user type anything, but if the input is invalid display the hint below the TextField with suggested corrections.

 

Another approach is creating a custom keyboard (Container with ImageButtons), but this will require creating a custom input field too. This should work for apps like calculators. I think it's not possible to replace the system keyboard.

 

Btw, when analyzing diffs between 1673 and 2318 SDK headers I've noticed that textFilter property appeared in TextArea control. I haven't tried to use it yet.

 

There's only one filter right now: SingleLineTextFilter.

https://developer.blackberry.com/cascades/reference/bb__cascades__singlelinetextfilter.html

 

Theoretically it should be possible to inherit from AbstractTextFilter to create other custom filters. UPD: seems it's not possible yet.

 


Andrey Fidrya, @zmeyc on twitter
Highlighted
Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

Re: Custom Keyboard?

Thanks for the detailed response.

 

I decided to just remove the chars from the text using:

 

str.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\\[\\\]\\\\]")));

 Thanks!

 

--------------------------------------------------------------------------------------------------
BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone