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
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: How can I programmatically copy and paste?

How does one SSH in?

 

Just for good measure, I tried "text/url" as well, same result.

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

Re: How can I programmatically copy and paste?

If you're already very experienced with SSH, the short answer is:

1. Make a 1024-bit RSA key
2. Run blackberry-connect from any of the SDKs with appropriate options (list by running with no options) to use that key and run sshd on the PB
3. Connect via SSH

If you're not familiar with it, the long answer is covered in past threads which you'd best searching for. If you can't find them, let me know which platform you're on (Mac? Windows?) and I'll point you to it. If you've gotten by this long without it, you probably don't need to start now just for this. :smileyhappy:

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!
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook

Re: How can I programmatically copy and paste?


peter9477 wrote:

Yeah, I was just catching up to you on that. Same path here.  Have you looked in it (via SSH) to see what's there?

 


This is totally off topic.  So you mean one could SSH into the PlayBook?  How?

Sucroid.com
Sweet Apps for the Fans
Developer
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: How can I programmatically copy and paste?

Ohhh... thank you.

 

So now I'm just confused why when I copy text, it should indicate that the text/plain format isn't present in the clipboard. Sounds like you have it all working?

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

Re: How can I programmatically copy and paste?

dbigham, are you copying it using the same APIs? Try just doing it from another app, or a text field?

You can actually just use the browser to inspect the contents of that folder. Run it, put a single forward slash in the address field, then navigate down to /accounts/1000/clipboard.

Sucroid, as I mentioned, please search the forum to learn more on that. The summary I just gave is sufficient if you're very familiar with SSH, and if not it's too involved for a post in this thread.

(There's going to be a community wiki coming online some time around the Jam, and I'm sure the details on SSH will be migrated there as one of the first useful pages.)

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
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: How can I programmatically copy and paste?

Oh hey, I didn't realize that you could use the browser to explore the file system. Very cool, thanks!

 

That solved it... found the right format... I had switched to "text/url" and forgot to switch back to "text/plain", and now everything is working.

 

It's pretty weird that one has to write:

 

if (!is_clipboard_format_present(format))

{

    ...

}

 

... in the case that the format IS present. But thanks so much for figuring that out.

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

Re: How can I programmatically copy and paste?

There's probably either something missing from the header file, or you're supposed to use a constant from some other place, like bps/bps.h where BPS_SUCCESS is defined as 0 and BPS_FAILURE as -1:

 

if (is_clipboard_format_present("text/url") == BPS_SUCCESS)
    {
    ...
    }

Or something like that.... presumably the documentation will show that, when it shows up.


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
dbigham
Posts: 552
Registered: ‎04-01-2009
My Device: Z10, PlayBook

Re: How can I programmatically copy and paste?