30 Topics

Member Avatar for
Member Avatar for scheppy

Hello all Im trying to make java robot hold down the command key. I have used the following code. robot.keyPress(KeyEvent.VK_META); robot.Delay(5000); robot.keyRelease(KeyEvent.VK_META); This doesant seem to do the trick. Yes I have searched on how to do this but cannot find a working answer. Am I using the wrong keycode? …

Member Avatar for JamesCherrill
0
2K
Member Avatar for DragonMastur

I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed?

Member Avatar for Gribouillis
0
458
Member Avatar for PerplexedB

Until now I've been replacing Enter key behaviour in controls (in base classes) with Tab key behaviour with the following code in the keypress event handler : If e.KeyChar = Chr(13) Then SendKeys.Send(vbTab) e.Handled = True End If Although it's worked for me until now, I have serious doubts about …

Member Avatar for Reverend Jim
0
1K
Member Avatar for Start4me

I'm trying to create a program which will work in the background and can be brought back to the topmost upon a keyboard shortcut. I got stuck when creating the multiple keypress statement, and not sure how to make the shortcut work when the form is not in focus. Here's …

Member Avatar for Reverend Jim
0
273
Member Avatar for aabbccbryanmark_1

Private Sub txtPassword_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPassword.KeyPress Dim NotAllowed As String = "~`@%^&+={[}]()!:,;'><?/|\-.#+()_$*" If e.KeyChar = ChrW(Keys.Enter) Then e.Handled = True End If If e.KeyChar <> ControlChars.Back = True Then If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then e.Handled = True End If End If End …

Member Avatar for Atove
0
2K
Member Avatar for Dum_Bass

My problem is that I wish to use a single mouse click (or key press) to "turn on" a set of conditions then I will "turn off" the conditions when a different requirement is met. Alas! Every time I release the mouse button the bool reverts to its initialized state. …

Member Avatar for Dum_Bass
0
230
Member Avatar for babateejay

I am working on a keyboard teaching aid similar to mavis beacon. With the following code i am able to detect if the enter key is pressed on the keyboard. If e.KeyChar = Microsoft.VisualBasic.ChrW(keys.enter) Then MsgBox("Enter key is pressed") End If but what i want to do is that i …

Member Avatar for Jx_Man
0
3K
Member Avatar for Start4me

I want this code to run in the background but still be active: Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress lblTest.Text &= e.KeyChar End Sub

Member Avatar for Start4me
0
282
Member Avatar for dgipling

I working with an application written in Visual Studio C++. Then program is a console application running under the DOS-prompt. The program is something like this. void main () { for ( ;; ) { do_something (); do_something_more () } } Now I need to add some code between do_something …

Member Avatar for richieking
0
237
Member Avatar for ohwhatacuteanaconda

I need assistance with using Keypress to only allow a certain range of numbers (1-26) to be typed into the textbox. When ever I do it, it only allows me to press the numbers "1 and 2". I'm very new to VB so the help is much obliged. I know …

Member Avatar for ohwhatacuteanaconda
0
391
Member Avatar for abhinashraju

Hi everybody, How to do the following in java..?? created a frame and one button added to that frame and set the keyboard shortcut to that button.Now my question is how to make that keyboard shortcut will work eventhough focus is not there in that frame? anyone have any idea..

Member Avatar for Taywin
0
236
Member Avatar for imobby

I need to highlight the current key pressed in my C# application. To get the keyboard keys code during keyDown and keyUp events i tried returning the keycodes as protected override void OnKeyDown(KeyEventArgs keyEvent) { // Gets the key code lblKeyCode.Text = "KeyCode: " + keyEvent.KeyCode.ToString(); } Other way i …

Member Avatar for mvxg
0
278
Member Avatar for wright67uk

Ive been playing around with a couple of scripts both of which work well on their own. The first is a basic alertbox that uses a hotkey; [Code] <script> $(document).jkey('o', function(){ alert('Pressed o');}); </script> [/code] The second is a custom alert box which displays after clicking on a link. How …

0
139
Member Avatar for bluehangook629

Ok this question is more like 'what is the term used for such as event?'. What I am trying to do with open a application config form in login window which is activated by combonation of keys pressed. for example alt+c or ctrl+alt+x. I tried using every term i can …

Member Avatar for bluehangook629
0
414
Member Avatar for RenanLazarotto

Hi! Since my last thread hasn't been answered and I simply cannot wait until it gets answered, how can I validade what is being written on a textbox? I need to know when the user types a "-" (minus) char. And when he do so, an message appears (preferably an …

Member Avatar for codeorder
0
172
Member Avatar for mamatachaudhari

Hi, I have added a keypress event as [CODE] jQuery('#body').keypress(function(){currentTime= new Date().getTime(); });[/CODE] but when I open a pop up window which have a iframe contains a rich text area not capturing this event. Any ways to handle parent event in child element? Any suggestion?

0
90
Member Avatar for david56connor

Hi, I have a piece of code which loops through checked checkboxes to do something with each of them. After each turn in the loop I want to pause before it continues to the next checkbox until the user enters a piece of text into the text box. I have …

Member Avatar for david56connor
0
2K
Member Avatar for jhai_salvador

Okay, this is just a simple trick to determine whether CAPS is pressed because some people here use API to determine whether the CAPS Lock is pressed. [QUOTE] KeyDown and KeyUp don't detect exactly the same information as KeyPress. KeyPress detects a character in its KeyAscii parameter, but KeyDown and …

Member Avatar for jhai_salvador
0
855
Member Avatar for ak24

How can I prevent the beep sound when I use the SendKey command in NumericUpDown1 Box? Here is the code: [CODE] Private Sub NumericUpDown1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NumericUpDown1.KeyPress Static SAME As Short = TB2 TB1 = SAME - NumericUpDown1.Value If e.KeyChar >= "0" And e.KeyChar …

0
111
Member Avatar for nore

Hello all, i want to know some textbox case. I want to make my textbox (example textbox1) only can be written by numeral, if there was non numeral input, textbox1 not allow or just being ignored. Thanks for attention or help :)

Member Avatar for nore
0
344
Member Avatar for dre-logics

I use Visual Basic 2008 I had this code in Visual Basic 6.0 that the replace the ASCII value of [COLOR="Red"]decimal point [/COLOR]for the ASCII value for a [COLOR="red"]comma[/COLOR][CODE] Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 46 Then KeyAscii =44 End Sub [/CODE] But this does not work Visual …

Member Avatar for codeorder
0
200
Member Avatar for miraj0072004

hello friends, I am making a GUI for a certain fill up form using netbeans..here I need disable a "next" button until all the text fields are filled up...I have tried writing a method that which is called during every keypress event in a text box that checks whether the …

Member Avatar for javaAddict
0
252
Member Avatar for ryan-t

Hi, I'm pretty sure this would be something I'd need javascript for. What i want to do is to recognize when a user presses the enter key while active on a text area and to insert a new line

Member Avatar for Airshow
0
157
Member Avatar for BasicDinosaur

Hi. This may seem simple to most but has consumed 3 days so far and a bit of $$ trying to learn simple how to use Enter as a Tab (Yes I know it is a Fau-par but I need it regardless). The idea is to move the focus to …

Member Avatar for finito
0
237
Member Avatar for tonymuilenburg

Hi all, I'm trying to capture an event when tab is pressed in a textbox using visual studio.net, and am having a hard time. I can capture anything else, inluding the keys that are difficult like instert, alt, and the arrow keys. Here is the MSDN page that did not …

Member Avatar for tonymuilenburg
0
296
Member Avatar for dylank

Hey Daniweb; Ive scoured the internet for scripts that make a <div> follow the mouse, and have found one that seems to work well. However, I want the <div> to stop moving when the CTRL or the SHIFT key is pressed, I dont care which. Hopefully, I can have a …

Member Avatar for Airshow
0
364
Member Avatar for random12810

I have no idea how to move a bitmap with the arrow keys. Here is my code [CODE] #include <windows.h> #include <tchar.h> #include <stdlib.h> #include <string.h> #include "Menu.h" #include "Icon.h" LPCTSTR ClsName = L"App"; // Class name LPCTSTR WndName = L"WindowsAPI"; // Window title HWND hwnd; // Handle to our …

Member Avatar for strmstn
0
2K
Member Avatar for TenaciousBey

Hi, I need to create a visual basic program that does all the functions of the calculator program in windows. I need to be able to make the program display the keys pressed by the user on the keypad (only the numbers 0 - 9) and it should also still …

Member Avatar for Romil797
-1
2K
Member Avatar for Moselekm

Alright, I have been struggling with this for a while. I just sort of want to grasp and test out everything I have learned, but that's hard to do when they don't seem to work. Basically all I want to do is cause an event [MessageBox] when I hit a …

Member Avatar for Geekitygeek
0
218
Member Avatar for vatsa.devil

i'm a little confused with the keypress thing.. this is how i write my code.. if(KEY_DOWN(VK_UP)){ // my statement ... } now what i want to achieve is, i want my statement to execute only once when i press up key. instead what happens is it keep executing till i …

Member Avatar for sfuo
0
225

The End.