Pong Using Keyboard?

Jul 14, 2011

I am trying to create a pong game. I have read and understood the tutorial on this website which I have also read the topic on this forum that has asked about using the keyboard in pong.This is the type of code they used which works:

Private Sub frmPong_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyValue = Keys.W Then

[code].....

View 1 Replies


ADVERTISEMENT

Key Down Event On Pong Game?

Mar 22, 2009

I successfully coded my up and down key so they move a paddle in a game of pong, however, when I press and hold up or down, the paddle will movie but has a delay before it starts to move. Is there anyway to remove this key press delay easily?

View 5 Replies

Adding Features To A Pong Game?

Apr 16, 2010

I actually found a fairly good pong tutorial on this site which I've linked to at the bottom of this post. I used the code as my base and I'm starting to implement my own new features. I'm currently working on making the ball move faster after each hit of the paddle, but I can't get it working! I thought it would be as simple as adding 1 to the 'speed' variable during the test to see if the ball has hit the paddle. Doesn't work! I also tried various other methods, including adding an extra timer to the form and having the speed increase a certain number every tick on the timer. Didn't work! Is there some special way that I need to reference that variable in order to manipulate it? Code below.

[Code]...

View 1 Replies

.net - Duplicating Effects: Dreamweaver Pong Easter Egg Beep?

Dec 28, 2009

I don't want to actually MAKE the pong easter egg, but for anyone with Dreamweaver, try typing 'dreamweaver' into the color selection box to play a round of pong.The bit that I want to know how it works is the bit at the end once you lose.After your loss, it will immediately play a small tune, whether or not your volume is on. In fact, it plays whether or not you have speakers, which makes me think the sound card itself is playing the tune.How can you achieve a similar effect, playing notes without sound or speakers, in vb.net? I would imagine this requires P/Invoke, seeing as there is no obvious way inside the framework.I don't need a whole song, a simple beep or the ability to change frequency of the beep will suffice.

View 1 Replies

Connect To Irc But Completly Stuck At Sending A PONG Back?

Nov 11, 2009

i'm trying to connect to irc but im completly stuck at sending a PONG back when i get a PING.i have tried to put an if statement checking if StreamR.readline = PING and then sending PONG + the value after ping back, but i just cant seem to get those numbers from ping.

[Code]...

View 6 Replies

Approach Affects Rebound - Creating The Classic Pong Game

Oct 8, 2011

I am currently creating the classic Pong game in VB.Net. I have a few questions regarding angle of approach and rebound.

For example if the ball hits the wall at roughly a 30 degree angle then it should roughly bounce off the wall at ~30 degrees. This is my first query, how would I achieve this as I cannot figure out how. It is currently bouncing the ball off the wall by altering ballXspeed and ballYspeed by 5 or -5.

My second query is that of the ball hitting the paddle, if the ball is to hit to top 0% - 5% of the paddle it will bounce off at a different angle opposed to if the ball hit the paddle in the 15% - 20% zone of the paddle.

Here is my code in its entirety:

Public Class Form1
Dim ballXSpeed As Single
Dim ballYSpeed As Single
[CODE]...

I understand that you cannot do the work for me and I don't expect you to. Would it be possible for help with the pseudo-logic or a particular area. I forgot to mention that the ball currently bounces off the paddles at a random angle.

Hence:

ballXSpeed = -5
ballYSpeed = New Random(DateTime.Now.Millisecond).Next(-10, 10)

View 1 Replies

Created A Virtual Keyboard Like The "Windows Onscreen Keyboard"?

Oct 13, 2010

I have created a virtual keyboard like the "Windows onscreen keyboard". So, I have used the method sendkeys.But if I click on the button, it doesn't write nothing.

I think I have a problem with the FOCUS.As you can see, the "Windows onscreen keyboard" is always on top.This doesn't happen to my form. How can I do?

View 4 Replies

Error When Opening On-Screen Keyboard In Windows 7 - "Could Not Start On-Screen Keyboard"?

Jan 4, 2010

oke On-Screen keyboard through my VB code. I am using windows 7 and below code to open the keyboard. Everytime when i run this code i am getting error "Could not start On-Screen keyboard".e to fix this error?

Dim proces As New Process
proces.StartInfo.UseShellExecute = False
proces.StartInfo.RedirectStandardOutput = True

[code].....

View 1 Replies

Blink The Keyboard's LED Using C#?

Nov 13, 2009

Need to make the Keyboard's LED (Caps lock / Num lock or Scroll lock LED) blink either using C# or VB.net. (With or without using interop is fine)

View 2 Replies

Disable Certain Keyboard Key ?

Nov 9, 2011

Is it possible to disable certain keyboard key?

View 1 Replies

Get A Key Pressed From The Keyboard?

Nov 7, 2010

This may sound like a dumb question but I need to know. I know you can tell which keys are pressed on the keyboard but I like to know if I can do something.Ok, heres what I am trying to do. A user is in another program that is max on the screen. He has to press Print Screen to take a screenshot, but he got to min the screen he is in to paste the screenshot into paint. This causes slow loads on maxing that screen and sometimes crashs of the program. I already got the code done to check when the program is running and to capture the screenshot and save it. What I to do now is, find out while in the other program with my program running in the background, if the user has pushed the Print Screen button.

View 2 Replies

Keyboard Chars

May 16, 2009

ok here is the situation. i have a form that is hidden. the form needs to wait until somone hits the F2 button.

View 1 Replies

Type F12 Through Keyboard?

Jun 9, 2011

I m writing a accounting application. I want to Display buttons With text "F12" underline For Keyboard shortcut like in tally 9.0.

I have tried to write &F12 in button text propertity but it doesn't work.

View 13 Replies

What Are The Following Key Constants On The Keyboard?

Sep 24, 2011

Can anyone explain what the following vbkey constants are as actual key presses? I've tried searching and really can't find any info other than vbKeyCancel = CANCEL key. Well, what's a cancel key? I dont have one on my keybaord...I read somewhere that CANCEL = Ctrl+C. Is that true? If so, what are the other few I have listed?

Constant
Value
Description[code].....

View 2 Replies

Add Keyboard Shortcuts To My Textbox?

Apr 20, 2009

I want to be able to edit my text box pretty much like you can with windows notepad..

in notepad, when you press CTRL + C , it copies, CTRL + V , pastes , and so on.

View 5 Replies

Add The Keyboard Shortcut Key Like Cntrl+key?

May 3, 2011

In my form have the Toolstrip menu and it have the 3 Buttuns with image and text. now I want to add the short cut key for this ToolStrip buttons like "Cntrl+any one char"

I dont want Alt+key type short cut. how can I add the keyboard short cut key using with Cntrl+key.

View 2 Replies

Anti-keylogging Keyboard?

Nov 19, 2009

Are there any known sofware approaches to anti-keylogging,that defeat both hardware and hook based loggers? While I was thinking about my next article, and the current ones, something dawned on me, that I had started before but never got to finish.After doing some research I verified that an On-screen keyboards, avoids most if not all hardware loggers, but the consensus is that their messages can still be hooked and stolen.Well maybe not so fast....

However, in my sendkeys article,the program could identify which keys were sent by my module, versus some other source.I used the integer -11, in the getextrainfo param, so that in my hook, I could know to allow my simulated keys, and block others that may interfere. Works great. I just used -11 for the heck of it.So, the idea is that we don't have to use -11.A sequence of random numbers could be generated by the osk.This provides some anonimity, to start with.But, the clincher is that when our user keys are detected by our osk(ourself basically), we simply insert 0-5 random keys, flooding the enemy logger with useless information in the que. Bingo!Sure they logged your keys, but can they read em? Nah.

The zero through five would not be fixed, but fluxuating, so it's not equidistant.I just picked them so as not to over flood the que for no reason. That is enough to obsure the password being typed.

View 5 Replies

Button Keyboard Shortcut?

Jun 21, 2010

i really dont get it. i want to put keyboard shortcuts on the button i have other than clicking this buttons. but the problem is i dont know how. i tried putting an ampersand (&) sign before the text of the buttons and it work, but the ampersand sign also displays. heres the original code:

Button1.Text = Mid(ChoosenWord, PickedSeq(0), 1)
Button2.Text = Mid(ChoosenWord, PickedSeq(1), 1)
Button3.Text = Mid(ChoosenWord, PickedSeq(2), 1)

[code]....

View 5 Replies

C# - Disable The Keyboard And Mouse?

May 13, 2010

I am looking to create a VB.NET application. when the application is opened it will disable the keyboard and mouse so if you hit any keys it does nothing and you can not move the mouse. (even if currently selected window is not that of application).

MUST WORK ON WINDOWS 7!

View 3 Replies

C# - Distinguish Between The Scanner And The Keyboard

Apr 12, 2011

I have a barcode scanner connected to a PC that working with a c# program.now i want to distinguish between the scanner and the keyboard which one is sending data to my program.

somebody said this to me in another topic(but i can't do this yet): basically you can configure the scanner to send some characters that basically tell the computer "hi, it's me". When you see those characters in your input stream, you know the information is coming from the barcode scanner, not from something the user typed on the keyboard. Did you check the manual that came with your barcode scanner? It should have more information about this.

View 2 Replies

Capture All Keyboard Events?

Aug 9, 2010

I've written an app with a simple textbox which attempts to identify a user from their typing habits (interval between key presses, duration key is held, time between key strokes ie a->s is quicker than a->v for some users, shorter for others depending on typing style). It's far from perfect but it does correctly identify moderate-large differences in style.I'm hoping to use this as a form of security monitor - If the typing style of the user doesn't fit a recognised pattern, report to a central server.

Of course, the next step in testing this is to begin to capture "regular" typing habits - ie when browsing, switching between apps, etc.What I can't figure out how to do is capture keyboard input for all applications (excluding the login/welcome screen, alternate desktops, etc. - I have no reason to parse that and there's probably not enough input to analyse anyway)Disclaimer: Yes, I know this comes dangerously close to writing a keylogger which is verboten but if I wanted to do that, I'd write a keyboard driver in C++ - I'm sure it would be far more streamlined and easier to obfuscate than a hulking .Net MSIL assembly. I have no doubt I'll be fending off "That's a keylogger" comments but I've hit a wall and need to ask somewhere.

View 2 Replies

Captures The Keyboard Events?

Mar 7, 2010

How do I make the form captures the keyboard events when it is inactive or was in the background in Visual Basic 2008

View 2 Replies

Change Tabs In IDE Using Keyboard?

Apr 2, 2009

Change tabs in the IDE using keyboard?

View 3 Replies

Control Specified Keyboard Lights

Jun 9, 2012

I have found a program called ledsdriver( http:slicksolution...edsdriver.shtml ). i can control the serial ports on your pc but also the keyboards lights (caps lock,num lock and scroll lock). The good thing is if i connect 2 keyboards i can chose which one i want to change the lights.I want to make one that could control the keyboard lights but only on one keyboard. I wold like to make my own because i could customize it(that one isn't open-source). How can i do that?

View 3 Replies

Create On Screen Keyboard?

Dec 15, 2011

I am creating a "form1" and adding "WebBrowser1" . Let's say the URL that I put on the WebBrowser1 has a username and password. So that, this will require a on screen keyboard in order to type the username and password. In this case, I do not want to use external OSK (on screen keyboard), what I want is to create some numerik numbers or letters on my form1 with buttons and then type it on the URL.

View 7 Replies

Determine If Any Keyboard Key Is Pressed?

Mar 3, 2012

I have a few problems with my VB.NET project. I am making an application that should track every key inputted by the user. This may sound scarily like a keylogger, but it is intended for statistics purpose only. All data is stored on the client's computer and will not be sent anywhere on a network or the Internet.

The problem is actually figuring whether or not a key is pressed globally. That means, not in a KeyDown, KeyUp or KeyPress event. Let's say if the user inputs anything in Microsoft Word, my application will notice.

I have already tried this code. It gives PInvokeStackImbalance errors in the MDA. It has actually worked out for another application I am making, until I figured the severity of this error.

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub CAKS(ByVal Key As Long)
Dim WasBeingHeld As Boolean = False

[Code]....

View 2 Replies

Disable Mouse And Keyboard?

Feb 1, 2009

Yes wat is the Source Code for Disabling Mouse and Keyboard?(For VB 2008)

View 2 Replies

DIY Calculator : Keyboard Vs. Mouse?

Apr 30, 2010

I am creating a DIY calculator.The one in W7, I can't hardly see. Mine is much simpler and larger.I currently have buttons for numeric 0 - 9, Add, Subtract, Multiply, Divide, Clear, Enter, and Decimal Point.There is a label at the top with displays results.If I use my mouse to select the buttons, then everything works okay. However, if I use the keyboard, I get strange results.I thought it may have been my old keyboard so I changed it.No difference.If it's not in the hardware, then it's in the code.The section below is what I have for keyboard use:

Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
Ch = e.KeyChar
Select Case Ch[code]....

For each of these, there is a corresponding Button_Click even farther down in the code. Since the mouse click on the buttons on the form works properly, the problem must be above. I can't see it.

View 16 Replies

Hook Keyboard With Program?

Jul 14, 2011

I want to hook keyboard with vb , so that whenever my application written in vb runs it will capture all the keys pressed from the keyboard and show all the keys being pressed in a textbox on window's form

View 1 Replies

How To Lock Keyboard And Mouse

Jun 8, 2011

I am using vb.net framework 3.5. I want to lock input devices like keyboard and mouse from my application. Is their is anyway using sendkeys or any method to lock?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved