DeactivateKeyboard from MouseUp

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

DeactivateKeyboard from MouseUp

Post by quailcreek » Sun May 31, 2015 1:51 am

Hi,
What message is send to deactivate the keyboard with the card is touched? I have a grc that covers the entire cd so touching the cd isn't possible. I know I could make the grc a background but I wanted to ask the experts first. Thanks.
Tom
MacBook Pro OS Mojave 10.14

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: DeactivateKeyboard from MouseUp

Post by Simon » Sun May 31, 2015 3:11 am

Hi quailcreek,
I may not have understood your question correctly but...
I usually put a rectangle graphic object in the lowest layer of the grp and add a mouseUp script to it.

Code: Select all

on mouseUp
   set the traversalOn of btn "focus" to true
   focus on btn "focus"
end mouseUp
I include a hidden button on the card called "focus"
...cd so touching the cd isn't possible
So not sure this will work?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: DeactivateKeyboard from MouseUp

Post by quailcreek » Sun May 31, 2015 3:40 am

Thanks, Simon. I put this in the grc. Works perfect.

Code: Select all

on mouseUp
focus on nothing
end mouseUp
Tom
MacBook Pro OS Mojave 10.14

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: DeactivateKeyboard from MouseUp

Post by Simon » Sun May 31, 2015 3:45 am

Hi Tom,
I once had a problem with "focus on nothing" so I don't trust it anymore.
Probably works fine.

Simon
Edit; Oh and "pass mouseUp" if you use it on the grp, or your fields won't get the touch. (I'm thinking)
Edit 2; on I see "grc" OK :)
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: DeactivateKeyboard from MouseUp

Post by quailcreek » Sun May 31, 2015 4:09 am

Thanks again, Simon. I'll watch out for the focus on nothing. Too bad printing the contents of a fld isn't as simple... or do you have a solution of that one too? ;-)
Tom
MacBook Pro OS Mojave 10.14

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: DeactivateKeyboard from MouseUp

Post by Simon » Sun May 31, 2015 4:56 am

Hi Tom,
Sorry I thought someone answered that one for you.
I have used;
create inv stack "print"
put the field into cd 1 of the new stack (doing all the resizing stuff) then just "print card 1 of stack "print"".

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: DeactivateKeyboard from MouseUp

Post by quailcreek » Sun May 31, 2015 5:52 am

Simon,
That sheds some lite on printing a fld. I didn't think iSO would allow 2 stacks to be open. So then I guess I could have a second stack all prepared and sized and have it loaded to the documents folder at installation. Then just open it as hidden and go from there. :-)
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: DeactivateKeyboard from MouseUp

Post by quailcreek » Mon Jun 01, 2015 2:14 am

OK I give. Been trying to resize the print stack ... all day. Did livecode remove the ability in iOS ? Resizing the stack works outside iOS.
Tom
MacBook Pro OS Mojave 10.14

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: DeactivateKeyboard from MouseUp

Post by Simon » Mon Jun 01, 2015 3:59 am

Hi Tom,
Ahh OK, you zoom the card, from the dictionary;
print card [from topLeft to rightBottom] [into pageRect]
Simpler- print cd 1 of stack "print" into 100,100,800,900
So you can keep it all really tiny until print time "into pageRect". I don't know what the pageRect of 8.5x11 paper is (left,top,right,bottom eg 100,100,800,900) but you can figure it out.
I admit the last time I did this was for iPad and everything fit so I didn't have to mess with into pageRect.
I think I saw in your other post something about setting up a separate .livecode file? When in the standalone you can just create the stack and it will go away on shut down or after the print just delete stack "print".

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply