Microsoft VB.NET 2010 - Assigning a Key to start a process when the window is minimized - vb.net

This is an auto talker that i created, but it isn't very convenient to click on start and stop when the text is being typed at 10 milliseconds. So i wanted to create a key that when pressed starts the auto typer, and also stops it. I have a box where the user can press a key to assign to start and stop the auto typing. What code would i put for clicking on assign? I want assign to: get key from textbox5.text and use it as the shortcut key to start spamming. The key would be pressed when the Interface for the spam bot is minimized, so i can't use "&Spambot" for S to be the shortcut key.
Any help would be appreciated.
Please click on the link below to see image
http://s16.postimg.org/6xdxtjvg5/Interface.png

I successfully used some methods to read the numkey state, started my stuff when it is turned on, and stop it when it is turned off again, maybe you will like that solution.
If Control.IsKeyLocked(Keys.NumLock) Then ...
your alternative would be to 1. use an keyDown event (i think it gave more information about pressed keys than key pressed event), then store it in a local variable
And finally using an external dll to figure out if any key is pressed anywhere in windows. And if, then compare if it is the correct key, and then trigger whatever you want to trigger.

Related

Handle Enter key in CoreUI's CInput control

My Vue.js view consists of a single CInput and a single send button (CButton). As a comfort feature, I want to trigger the send method, when the user hits the Enter key as long as the text input has focus. According to the official documentation, only the #input, #update:value and #change events can be used by this control. But I haven't found any clue about the pressed key.
I tried using the #input handler, which offers two arguments. The first one is the new value itself, and the second one is an event argument, but I can't find any hint of a key code there.
How can I find out, which key the user pressed and call my send method in case of the Enter key (keycode 13)?
v-on:keypress.enter="your method"

KeyDown : detect either control key alone or control key used as a modifier

The user will type in a datagridview the shortcuts he would like to assign to a couple of operations. I tried to use KeyDown event when the cell is in edit mode.
However I want my control to be able to detect in the same event handler the Control key typed alone, or the Control key used as a modifier (same with Shift and Alt).
This causes a problem since KeyDown fires up when Control is down before the other key I am combining it with is also down. Obviously the event handler doesn't know if the user intends on pressing another key after the Control key.
Right now I solved this issue by using KeyUp, but this caused other headaches when for example the user types in CTRL+P, releases P, which fires the correct event, but then the user releases Ctrl which fires a new KeyUp event which I had to find a way to ignore.
There must be a cleaner way to handle this?

VB.net suggestions to avoid keyloggers spy on my textbox password?

How it could be done?
So far i seen on Google:
Virtual keyboard
Add some events to my textbox to cancel the key event.
When key pressed record what has been pressed save and then simulate other 10 random keys?
what else can be done and not to build the whole anti-keylogger antivirus.
It can be done anything that your imagination let you:
You could tell the user to put his/her password using the key in the direction you want, for example on the right. And control the symbols with your application (with a Dictionary for example). You could show a standart keyboard picture to the user to be sure.
You could tell the user to put a letter you show to him/her every X keys pressed, or just press any key he/she wants and discard it.
You could tell the user to put a letter you show to him/her after each key of password pressed.
You could tell the user to put only the even characters of his password, and later ask for the rest.
You could tell the user to put the password backwards.
But I think a Virtual Keyboard is the best option.

Word VBA event for detecting text change in the document?

I'm working on a macro for Word which detects key words in the text while these are typed.
for example, I want that a Table will be added when the user types \table or something like that.. very similar to lyx context, but yet nothing like it.
The table example is very simple compare to the ideas I want to implement with this.
I'm looking for an event in VBA that will be triggered whenever the used types something.
There is an event called WindowSelectionChange (Reference: Event - Document Edited) but it triggers only whenever the SELECTION is changed, meaning only when the user selects another area in the document with the mouse cursor, or whenever the user moves with the keyboard arrows in the document, but doesn't triggers when the user types text (or press Enter, Space, etc...).
Seems an answer is explained here:
What events can I use to monitor users typing in Word?
Shortly - no events on type text in word: use either Windows API hooks, or assign key bindings to all keys.

How to give users a certain time to enter something? (VB.Net)

I'm making a speed game in VB.Net (Console Application) and users have a certain time to press a certain key. So how can I give the Console.ReadKey function a timeout without just waiting until a key was pressed?
You should use a timer. When the user selects the correct key you can disable it. If the user is to then choose a different key you can just reset it.