I am using VS2008, OS win vista. i am in the process of coding an application that would tab automatically (this is just an example, not the code i am intending to do).

So basically, what i expect is to write a C++ code that could press the 'tab' button twice from the code it it self. Can someone point me the correct google search terms or a tutorial to get familiar with these.

Thank you

What do you mean by "press the 'tab' button twice"?

If you want to use a tab to push console output to the right a few lines, use the '\t' escape character.

#include <iostream>

using namespace std;

int main() {
  cout << "\t\tThis output is tabbed over..." << endl;
  cout << "This output is not..." << endl;
  cin.get();
  return 0;
}

If you're trying to move through a GUI with the TAB, I'm afraid I can't help you.

Edited 5 Years Ago by Fbody: Small code glitch

No you got me wrong. For example. when we click the 'tab' button on the keyboard, it sets focus to the next tab index, right ?? so what i need to do is to enter these tabs from the code instead of using the keyboard to set focus to the next tab index.

hope i made it clear.

So you're trying to move around a GUI. As I mentioned before, I can't help you with that one... I don't do GUIs.

I know there is a way to set the default focus. Is that what you are trying to do is automatically set the focus? I believe you have to set the "tabstop" (or whatever the proper property name is) to 0 to make that the default focus. But that's all I can offer you.

Edited 5 Years Ago by Fbody: n/a

I know there is a series of constants that can be used to identify the keys on the keyboard, you'll probably have to use one of those.

Try searching for "Windows Keyboard Codes" and similar. Then, if there is a way to send (rather than receive) the constant/code for a key, send the appropriate one for TAB.

Edited 5 Years Ago by Fbody: n/a

This article has been dead for over six months. Start a new discussion instead.