473,320 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Windows Key Delay?

Griffen25
howdy, i'm currently teaching myself VB-6.0 and i'm having some troubles of mine with a simple game of "Pong" hehe

My Problem:

I've mannaged to bind A & Z to up and down respectivly, but my problem is Windows Key Delay, i am "unable" to hold down A or Z without waiting about 1sec before a continous movement occurs, and if any other buttons are pressed instantly the movement of the image stops.

Can anyone out there please help me with a code to allow me to hold A or Z and instantly allow continous movement for my image?
Oct 25 '06 #1
2 2155
albertw
267 100+
howdy, i'm currently teaching myself VB-6.0 and i'm having some troubles of mine with a simple game of "Pong" hehe

My Problem:

I've mannaged to bind A & Z to up and down respectivly, but my problem is Windows Key Delay, i am "unable" to hold down A or Z without waiting about 1sec before a continous movement occurs, and if any other buttons are pressed instantly the movement of the image stops.

Can anyone out there please help me with a code to allow me to hold A or Z and instantly allow continous movement for my image?
hi
try the statement 'doevents' in your keypress sub.
this may refresh the new situation
Oct 25 '06 #2
Killer42
8,435 Expert 8TB
hi
try the statement 'doevents' in your keypress sub.
this may refresh the new situation
My guess is you're using the wrong events. KeyDown and KeyUp may be more helpful than KeyPress. They will let you track when each key is pressed and released, even if they overlap (two players, perhaps).
I've just tested this, and found that KeyDown keeps repeating much like KeyPress. But just ignore the duplicates (same KeyCode value) and wait for KeyUp.
Oct 27 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200,...
6
by: carbon_dragon | last post by:
Ok, so here is the problem. I'm working on a headless server program implemented as a .NET C# Console project. There is a UPS mounted to this server (though not a windows compliant UPS). I can only...
0
by: Phil G. | last post by:
Hi, my 'project' requires that I create a form with text info. at set time periods. These time periods are not evenly spaced so I pass a param for the delay(seconds). In order to debug this I have...
1
by: Zubair.NET! | last post by:
In our web application we are calling different XML Webservices and make approximately 25 calls every 10 minutes. We use a separate thread to call a the webservice (Crawler) and populate our cache...
3
by: Michael | last post by:
Hello, I have created a windows service in C# that watches a folder, then moves files place in it to another server. When I test this service on my local machine it runs great. I have had it...
4
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding, and if not...
6
sashi
by: sashi | last post by:
Shut down Windows For various reasons you may require a shut down of Windows to happen programmatically. For instance if the installation of your program requires system reconfiguration. The...
30
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table....
1
by: coolsti | last post by:
I am having a curious problem with Vista working on a Lenovo thinkpad. To test and demonstrate this problem, I have a PHP script that does not terminate. It enters an infinite loop where it...
7
by: ankry | last post by:
When using PHP 5.3.1 + Apache 2.2.14 on Windows XP machine I encounter the following problem. A PHP script generates a form with method=POST. The script mentioned in the form's action parameter...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.