[27 Feb 2010] Are there issues with key events in windows?

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

[27 Feb 2010] Are there issues with key events in windows?

Post by TheMartian »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 27 Feb 2010 13:00:04 -0000

Hi

Are there any known issues with key events if a Hollywood program is compiled for Windows (XP in my case)? I copied the code from my amiga Hollywood version to the Windows version and have made no changes except to the paths used in some @INCLUDE statements.

I have this textbox control (A better and faster version of the control I published 1-2 years ago) that runs very well on either an A1 or a SAM-Flex, but it runs miserably (if correctly) on a much more powerful PC. Basically it only accepts or at least displays new keystrokes perhaps every half second or so whereas the same code eats through any number of key strokes as fast as I can type on the Amiga.

Events run off the standard WaitEvent() loop and the text area is redrawn by writing to a brush using TextOut() and copying the brush to the text area of the control. But somehow I don't think that redrawing a brush can cause delays like this in Windows.

regards Jesper
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[01 Mar 2010] Re: Are there issues with key events in windows?

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 01 Mar 2010 22:30:42 +0100
Hi

Are there any known issues with key events if a Hollywood program is compiled for Windows (XP in my case)? I copied the code from my amiga Hollywood version to the Windows version and have made no changes except to the paths used in some @INCLUDE statements.

I have this textbox control (A better and faster version of the control I published 1-2 years ago) that runs very well on either an A1 or a SAM-Flex, but it runs miserably (if correctly) on a much more powerful PC. Basically it only accepts or at least displays new keystrokes perhaps every half second or so whereas the same code eats through any number of key strokes as fast as I can type on the Amiga.

Events run off the standard WaitEvent() loop and the text area is redrawn by writing to a brush using TextOut() and copying the brush to the text area of the control. But somehow I don't think that redrawing a brush can cause delays like this in Windows.
It's most likely a programming error because the text control of Fabio's SCUILib runs very fast on Windows machines so we can rule out a general problem with Hollywood's keyboard handler on Windows.

You might want to check the SCUILib source first to see how Fabio has done it. If you still think it is a Hollywood error, please provide some demonstration code but of course it must be as short as humanly possible :)
User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

[02 Mar 2010] Re: Are there issues with key events in windows?

Post by TheMartian »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 02 Mar 2010 19:49:18 -0000

Hi Andreas

I looked for a way to do a simple test and tested this bit of code:

Code: Select all

keyeventhandler=Function(msg)
Switch msg.action
Case "OnKeyDown":
	Print(msg.key)
	If msg.key="A" Then flag=False
EndSwitch
EndFunction

InstallEventHandler({OnKeyDown=keyeventhandler})

flag=True
While flag
	WaitEvent
Wend
End
What I see is that frequently if i hit the same key in quick succession the system catches on to the first few keys and then start ignoring some of the key hits.

Also keeping the same key pressed can provoke it every now and then.

Writing sentences quickly using both hands (10-finger) seems to be a sure way of losing characters.

I have tested using two different wireless USB keyboards each with its own transmitters in case one keyboard was low on battery or some other hardware problem.

I use XP Pro (2002) SP3. System properties report no issues with either keyboard.

Do you need other information?

regards Jesper
User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

[03 Mar 2010] Re: Are there issues with key events in windows?

Post by TheMartian »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 03 Mar 2010 05:22:55 -0000

Hi

I just did a test with the SCUIlib demo program as found on the new disk for the Windows version for Hollywood. I have the same problem there, when entering text in the text box. This could imply that it is something specific to my PC, if others don't have this problem. I will have to test this on some other PC. I'll report back on that.

regards Jesper
User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

[03 Mar 2010] Re: Are there issues with key events in windows?

Post by TheMartian »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 03 Mar 2010 19:07:55 -0000

Hi

I have now cross-checked using another pc. It works flawlessly. It also works with the keyboards that won't work on my pc. So obviously the fault is with my pc. Good news for everyone else. Not so much for me :-) Sorry for the disturbance.

Just for good measure I connected an old keyboard to my pc using the PS2 port. It also fails like the others. The only strange thing is that they all work with other applications. Anyway, as I generally use the Amiga when programming Hollywood I can live with my pc being odd in this respect.

regards Jesper
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

[03 Mar 2010] Re: Are there issues with key events in windows?

Post by Allanon »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 03 Mar 2010 22:16:28 -0000

Hello Jesper, Just for the record I've no issues on my notebook with Vista32, nor on my desktop with XP. I've no idea which problem could cause your problem...

Regards, Fabio
User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

[05 Mar 2010] Re: Are there issues with key events in windows?

Post by TheMartian »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 05 Mar 2010 16:53:48 -0000

Hi

No. The error is obviously with my PC. Testing on another machine I had no problems. I must admit that a general keyboard problem was not first on my list of potential explanations for the strange behaviour I saw. As you I am clueless why it fails as I have not otherwise had any problems typing on the machine. I suppose it is on the generic keyboard driver level since it affects USB as well as PS2 keyboards. But I won't loose any sleep over it :-)

rgds Jesper
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[05 Mar 2010] Re: Re: Are there issues with key events in windows?

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 05 Mar 2010 22:37:43 +0100
Hi

No. The error is obviously with my PC. Testing on another machine I had no problems. I must admit that a general keyboard problem was not first on my list of potential explanations for the strange behaviour I saw. As you I am clueless why it fails as I have not otherwise had any problems typing on the machine. I suppose it is on the generic keyboard driver level since it affects USB as well as PS2 keyboards. But I won't loose any sleep over it :-)
Ok, a little bit of doubt remains though, because all other programs seem to work. It's a little bit suspicious if only Hollywood shows problems :) But on the positive side, I'll probably rework the Win32 keyboard handler sometime soon because I also experienced some things that I don't like. Not really bugs, but stuff that could be implemented smoother :)
Locked