revBrowserOpenCef causes keyboard problems

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

revBrowserOpenCef causes keyboard problems

Post by hylton » Mon Apr 06, 2015 9:52 am

Windows 7 Pro 64-bit
LiveCode 7.0.3

My laptop keyboard functions normally, inside Windows and LiveCode, until I load a stack with revBrowserOpenCef, then it drops keystrokes. If I type normally it may recognise approximately 3 to 6 keystrokes, then it hangs, dropping any keystrokes I type after that point. It will then accept more keystrokes and drop keystrokes again.

It doesn't matter where in the IDE I type, whether searching the dictionary or typing code in the card script, the same is true. As soon as I switch to another app, like Notepad, my keyboard works normally again. Using the task manager, I see that LiveCode uses 0% CPU and 65MB of RAM.

If I reopen LiveCode with another stack, which does not include the revBrowserOpenCef function, the keyboard works normally.

Here is the only code in the stack, which is the card script:

Code: Select all

local lBrowserID

on openCard

lock messages
put revBrowserOpenCef (the windowId of this stack) into lBrowserID
unlock messages

if lBrowserID is an integer then
   revBrowserSet lBrowserID, "rect", the rect of graphic "browserBackground"
   revBrowserSet lBrowserID, "url", "http://www.google.com"
else
   answer "Failed to open browser"
end if
end openCard
The stack opens correctly, and loads Google, but the keyboard doesn't work properly.

Update 1: The line that causes the problem is:

Code: Select all

put revBrowserOpenCef (the windowId of this stack) into lBrowserID
As soon as I comment that line out, the problem disappears, which confirms that the problem is with calling revBrowserOpenCef.

Update 2: Switching off strict compilation mode did not help.
Last edited by hylton on Mon Apr 06, 2015 4:25 pm, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowserOpenCef causes keyboard problems

Post by Mark » Mon Apr 06, 2015 3:58 pm

Hi,

Try

Code: Select all

put revBrowserOpenCef (the windowId of this stack,"") into lBrowserID
I don't think it has anything to do with your keyboard. The revBrowserOpen command doesn't like it if there is only 1 argument. I suspect revBrowserOpenCef has the same problem. I haven't tested it, but I always use this function with two arguments, the second one being empty if necessary, and since then I never had this problem.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

Re: revBrowserOpenCef causes keyboard problems

Post by hylton » Mon Apr 06, 2015 4:34 pm

Hi Mark

Thank you for your suggestion, but unfortunately it doesn't help.

I have also tried entering a full URL as the second argument, but that doesn't help either.

Here is the same sentence typed twice:

Typed in notepad: Let me type at my normal pace
Typed in LiveCode: Letme typeat m nomace

ToddFabacher
Posts: 280
Joined: Fri Jan 09, 2015 6:15 pm

Re: revBrowserOpenCef causes keyboard problems

Post by ToddFabacher » Mon Apr 06, 2015 8:59 pm

I tested the code here and I did not run into a problem. Can you create a small app and upload it so I can test it.

Are you on a Mac or a PC?

--Todd

hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

Re: revBrowserOpenCef causes keyboard problems

Post by hylton » Mon Apr 06, 2015 9:30 pm

Hi Todd

Thank you for looking at this.

I'm on a PC:
Windows 7 64-bit
LiveCode 7.0.3
Strict compilation mode: on/off makes no difference.

The exact same thing happens with the supplied course material, Week 5 Day 1, so no need to upload a sample file.

It's as if LiveCode is hanging or thrashing and can't keep up with simple keystrokes, but when I check the task manger, it is sitting idle at 0% CPU, and 65MB RAM.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowserOpenCef causes keyboard problems

Post by Mark » Mon Apr 06, 2015 9:33 pm

Hi,

Do you have a link to the "course material", which allows me to download a stack to test the exact same code that causes you this problem?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

Re: revBrowserOpenCef causes keyboard problems

Post by hylton » Mon Apr 06, 2015 9:53 pm

Hi Mark and Todd

Please find my stack attached.

The exact same problem exists with far less code.
Attachments
01. Browser UI.zip
(1.09 KiB) Downloaded 189 times

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: revBrowserOpenCef causes keyboard problems

Post by Mark » Mon Apr 06, 2015 10:23 pm

Hi,

There is definitely a problem with LiveCode 7. Once the browser has focus, you can't move the focus to a control anymore. At least not in your stack on Windows 8. Loading takes quite a lot of time, but typing in the Google search field works fine. However, this is probably not what you mean.

Once I manage to move the focus to the field control, I can type without a problem. The behaviour you describe cannot be observed on my PC, running Windows 8 and LiveCode 7.0.0.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

Re: revBrowserOpenCef causes keyboard problems

Post by hylton » Mon Apr 06, 2015 11:47 pm

To help you see what happens on my laptop, I created a screen capture:

Screen Capture.mp4 [2.6MB]

It shows the following:

1. My laptop having an uptime of 6 minutes, so it is after a reboot.
2. The taskbar having no other software open, except for the screen capture software.
3. The stack being opened and loading successfully.
4. The card script being opened.
5. Me typing 4 comments in Notepad.
6. Me typing the exact same comments into the card script.

You will notice all the dropped keystrokes in the card script.

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

Re: revBrowserOpenCef causes keyboard problems

Post by Simon » Tue Apr 07, 2015 2:13 am

I'm getting the same error but far worse on my win 7 with liveCode 7.0.3

Simon
Edit, for those who didn't see the movie, one cannot type into the Script Editor once this stack is opened.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

hylton
Posts: 53
Joined: Thu Oct 04, 2012 12:49 pm

Re: revBrowserOpenCef causes keyboard problems

Post by hylton » Wed Apr 08, 2015 8:28 am

At Heather's request, I have filed a bug report.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”