30 Topics
| |
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? … | |
I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed? | |
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 … | |
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 … | |
| 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 … |
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. … | |
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 … | |
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 | |
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 … | |
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 … | |
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.. | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
| 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 … |
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 … | |
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 … | |
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 :) | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.