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

Reply
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

is it possible to cover the keyboard

[ Edited ]

I have a situation where the keyboard is opening a little sooner than i would like, would it be possible to place a container above it and then i can move the container to reveal the keyboard when Im ready for it to be visible

 

or alternatively, the keyboard is being opened before i want it to because it was foucsed on a text area when the application was minimized so something is telling it to open when the app is active again but i've not been able to stop it

 

i am able to catch it while its opening & then force it to close & then re-open when i want but that doesnt look so great

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: is it possible to cover the keyboard

The keyboard is being made to appear in an entirely separate screen context (as far as I understand it), and is therefore not in any way connected to your app visually. Basically it's on a higher layer than your entire app. There's simply no way to "cover it up" as you describe.

What's the use case here? Maybe there's a better approach to handling it. After all, a user can and should be allowed to pop the keyboard open at any time with a two-fingered swipe from the bottom bezel, and interfering with this is likely to annoy people.

Is this something that perhaps you're doing as a workaround for other things that could be fixed with a bit of extra work?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: is it possible to cover the keyboard

[ Edited ]

the keyboard swipe hasn't worked by default for anything since the dev alpha 10.9 update, it used to work in my app until then (I don't particularly miss it)

 

my slog2 output is like this:

slog2info.png

 

I'm not sure how to counteract that

 

I don't want the keyboard open for another 100 lines at least Smiley Wink

 

Developer
Posts: 323
Registered: ‎05-07-2009
My Device: BlackBerry Z10, PlayBook, 9900
My Carrier: Telus

Re: is it possible to cover the keyboard

Can't quite tell from the log but are you auto focusing an editable field?

If so can you delay the focus until your app has fully loaded (or if really not desired.. Not focus at all?)

PlayBook Apps: DataMine, Dots + Boxes, 5 Marbles
BlackBerry SmartPhone Apps: 5 Marbles Soon: **** (D.Z.A), ****Quest, **** Challenge, VaultCracker, DevBrowser, Radial****
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: is it possible to cover the keyboard

You should probably focus on avoiding giving focus to the field at all...


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: is it possible to cover the keyboard

[ Edited ]

It's a text area so it does have to have focus at some point, currently on touch() however the only way I found to interfere with the focus is focusRetentionPolicy, but I don't get how I could tell it to take focus on application minimized, the options it provides take the focus once another object is touched

 

Edit:  I've discovered what would solve the issue 

 

when the screen is touched at y.1280 + the keyboard should close

 

however im not able to capture any touch events that originate past y.1279, I have been able to receive the location of an up event if the down originated from before 1280

 

I belive it is because it is tied to minimizing the application.  I've tried to subscribe to bps navigator event, NAVIGATOR_SWIPE_START but when i do that i loose access to onTouch: & i'm unsure how to figure out my X & Y

 

 

Highlighted
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: is it possible to cover the keyboard

[ Edited ]

I've created a movement tracker, if i go from the middle of the screen down to the bottom bezel, back above the bezel & then back under it then starts calulating +1280

 

import bb.cascades 1.0

Page {
    //to use NAVIGATOR_SWIPE_START the signal would be attached here.
    //while inside the root container onTouch: {} can be used, however out here it cannot
    Container {
        id: root
        property int downY: 0
        property int downX: 0
        property int movingX: 0
        property int movingY: 0
        property int upX: 0
        property int upY: 0
        onTouch: {
            movingX = event.localX
            movingY = event.localY
            instructionLabel.visible = false
            if (event.isDown()){
                downY = event.windowY;
                downX = event.windowX;
                } else if (event.isUp()){
                    upX = event.localX
                    upY = event.localY
                    }
            }
        onDownYChanged:{
            downYLabel.text = "Touch Down @: X " + downY
            }
        onDownXChanged: {
            downXLabel.text = "Touch Down @: X " + downX
            }
        onMovingXChanged: {
            movingXLabel.text = "Current Pos: X " + movingX
            }
        onMovingYChanged: {
            movingYLabel.text = "Current Pos: Y " + movingY
            }
        onUpXChanged: {
            upXLabel.text = "Touch Released @: X " + upX
            }
        onUpYChanged: {
            upYLabel.text = "Touch Released @: Y " + upY
            }
        layout: DockLayout {
        }
        Container {
            id: locationLabelHolder
            layout: StackLayout {
                orientation: LayoutOrientation.TopToBottom
                }
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
            Label {
                id: instructionLabel
                text: "Touch to start Tracking!"
                }
            Label {
                id: downXLabel
                }
            Label {
                id: downYLabel
                }
            Label {
                id: movingXLabel
                }
            Label {
                id: movingYLabel
                }
            Label {
                id: upXLabel
                }
            Label {
                id: upYLabel
                }
            }
        }
    
    }