Is there a command in arduino that can read from the keyboard to carry out a function? - arduino-ide

I'm looking for a command that reads user input from the keyboard (example: user presses the letter 'a') and a function is carried out in the loop (example: if 'a' is pressed -> carry out this function).
First time posting so let me know if my etiquette is wrong.
Thanks!

Yes, there is something like that called the serial monitor. Access it by pressing the tools menu, and then the serial monitor. I hope tthis helps!

Related

Closing Access from Command Button

Hey I am trying to fina a way to actually close acces from the close command button on a form. Is this possible? Right now it only closes the form and the user still has to exit out of the actual Access program. I want the user to be able to hit the command button and completely exit out of Access and go back to their desktop.
Thanks!
The OnClick event needs to be: Application.Quit
I might have misunderstood or not explained well. You need to create a command button. Caption it say 'Quit' and make the OnClick event Application.Quit. Before Application.Quit you could insert a MsgBox function to explain what will happen and ask the user if this is really what they want. Come back if you want more help on this.
Just tried the quit button on one of my databases with another form open. The database close with no problem - no need to specially close the open form.
I remember years ago I had to do this, and one of the things I learned is that you have to iterate through all your open forms and close them before you make the call to Application.Quit. I don't remember the details as to why I had to do it but I remember it solved a similar problem for me back then.

Octave input from keyboard not working in a script

I'm writing a script in octave that needs an input from keyboard in order to select a function to be used further. I've read the documentation and understood that
ans = input("choose...")
should wait for the for the input and store it in the ans variable. When I use it in the octave terminal it works just fine, but it doesn't when I insert it in my script : It shows the message "choose..." but it doesn't wait.
I don't get it, What I am missing.
Thanks,

Sublime text 2 tab through multiple selection

Lets say that I have selected the word 'test' three times using ctr + d.
Is there a way to tab through the selections. So for example if I wanted to go to the second word and only change that one.
I seem to need this quite often but I cannot find it anywhere.
And I also know about the skipping with ctr + d and ctr + k but this is not what I mean.
The MultiEditUtils package supports this.
Just install the package and bind a key to the selection_fields command, e.g.
{ "keys": ["alt+d"], "command": "selection_fields" },
To use it just create your multiple selection and press the keybinding. Then you can use tab and shift+tab to tab through the selection. If you tab behind the last one or press escape, then the multiple selection will be restored.
Demo:
It sounds like what you want is search. Sublime's search is accessed via Control+F (Windows/Linux), or Command+F (Mac). Sublime's search behaves similarly to many other applications, often web browsers have this feature. You can use this to cycle through instances until you find the one you were looking for. If you then hit enter, search will exit and the cursor will stop at the currently selected instance of your word.
See Sublime's unofficial docs for more details about its full search capabilities.
Hit Control+F to bring up the search
Type the term you want to replace
Put your cursor at the beginning of your document
Hit Control+G to select one
instance after the other and change it

Spawn xterm and issue commands using Expect

I'm trying to write a GUI using Tcl/tk where the user will select different parameters and hit a 'Submit' button. When the button is pressed, the program will open an xterm window and telnet and perform configurations based on the choices made by the user. I know this should be pretty basic but I've looked everywhere and cannot find a working method. Please advise. Thanks.
I think xterm isn't needed: Expect is able to provide a program (telnet in your case) with a pseudoterminal -- one of the things xterm does for the program it's running. So just google for this combo.
I don't believe that expect can control an X app such as xterm. It can however control a text app like telnet.
You can write a shell script that launches xterm, passing the "-e" option to execute an expect script. That expect script can then launch telnet.

Modifying a program to fake a button press

I have an MFC application that I was given (without source code) which opens a window with an 'Update' button, which then performs a very long update after being clicked.
I'd like to modify the program so that when the window is created (or somewhere else such as DoModal), a message is sent to the program to make it think that the button was pressed.
I've been toying around with this for a while in Ida Pro and OllyDbg to no avail. I looked at possibly using PumpMessage, but this did not bring any success.
Any advice?
If you don't like the idea of using a secondary "macro" program, you could patch the original program's binary to call the button's BM_CLICK handler. If you can find some space for the call (minimum 5 bytes without arguments), you can do this with OllyDbg alone (after editing the code, select it, and select "Copy to executable" -> "Selection" from the right-click menu). Otherwise, you'll need to create a new code section with a PE editor (e.g. LordPE or PE Tools) and add your code there (typically you'll want to change a call in the program to a jump to your section, where you perform the original call plus the call to the button's click handler, then jump back to the old position after your patched jump).
There are a few ways to do it using test automation techniques, but the simplest is to simply get the window handle for the button you want and send it a BM_CLICK message. This assumes that you have a working knowledge of C/C++ on Windows. If not, there are other means using .NET or other technologies. I'm not familiar with ida-pro or ollydbg.
See this perl module win32::guitest it could help you to do this.you can write with it a perl script and embed it in your program. or you can use the win32 api that wrap your required needs and use it.
Just create a 2nd program that will lunch it and will send a mouse click using SendInput(...)