Page 1 of 1

revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 9:52 am
by hylton
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.

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 3:58 pm
by Mark
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

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 4:34 pm
by hylton
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

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 8:59 pm
by ToddFabacher
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

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 9:30 pm
by hylton
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.

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 9:33 pm
by Mark
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

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 9:53 pm
by hylton
Hi Mark and Todd

Please find my stack attached.

The exact same problem exists with far less code.

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 10:23 pm
by Mark
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

Re: revBrowserOpenCef causes keyboard problems

Posted: Mon Apr 06, 2015 11:47 pm
by hylton
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.

Re: revBrowserOpenCef causes keyboard problems

Posted: Tue Apr 07, 2015 2:13 am
by Simon
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.

Re: revBrowserOpenCef causes keyboard problems

Posted: Wed Apr 08, 2015 8:28 am
by hylton
At Heather's request, I have filed a bug report.