Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hello i am currently working on making my own auto typer program. I know i could just go and download one but i think it would be cool to make one myself and include all the features that i would want. also this will help me get better at programming. So far i made a form that uses a timer. You can enter any message and set it to display after a certain amount of time. Now i want to make another form that is used by "hotkeys?" maybe they are called. I want to be able to display a message in a text box and have it type itself out after i press // or any combination i choose. Im not sure how to use key combinations to display a message. I want to use combinations instead of using a timer, I was wondering how would i do this? I been doing research but so far i have had no luck. Any suggestions would be great.

Thanks, here is what i have for a timer auto typer form working.


http://s24.postimg.org/5y1bs8g5h/My_Auto_Typer.jpg

C#
    public partial class AutoMessageTimer : Form
    {
        public AutoMessageTimer()
        {
            InitializeComponent();

        }

        private void SetTime()
        {
            timerMessage.Interval = Convert.ToInt32(txtTimer.Text);        
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
           timerMessage.Enabled = true;
           SetTime();
        }

        private void btnStop_Click(object sender, EventArgs e)
        {
            timerMessage.Enabled = false;
            SetTime();
        }

        private void timerMessage_Tick(object sender, EventArgs e)
        {
            SendKeys.Send(txtMessage.Text + "{enter}");
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
           // Application.Exit();
        }
    }
}
Posted
Comments
BillWoodruff 26-Dec-13 1:45am    
Is your goal to have a run-time user-definable, and user-editable, set of text fragments that will be auto-inserted in a specific TextBox that currently has Focus ? Or ... in any TextBox that has focus ?

Or, would you prefer to have predefined text-fragments that are set by you in code ?

Have you studied how to use the Windows Forms Key Events ... KeyUp, KeyDown ? Have you studied how to determine if various ModifierKeys, like Alt, Control, etc., are pressed ?

Do you have some ideas about which key-combinations you'd like to use ?
TheBigBearNow 28-Dec-13 19:30pm    
anything really i could predefine the combinations in my code or have them set by the user i will have simple combinations like "//" and other combinations that will enter a username and password of multiple accounts with the correct key combination thats what i want this for. I dont mind if i have to hard code it or if i can have the user enter the phrase and key code in seperate text boxes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900