# How to automate keystroke using Ruby?

**URL:** <https://www.ruby-forum.com/t/how-to-automate-keystroke-using-ruby/172621>\
**Category:** Ruby\
**Created:** [July 24, 2009, 7:21am UTC](https://www.ruby-forum.com/t/how-to-automate-keystroke-using-ruby/172621 "2009-07-24T07:21:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [July 24, 2009, 7:21am UTC](https://www.ruby-forum.com/t/how-to-automate-keystroke-using-ruby/172621/1 "2009-07-24T07:21:41Z")

</div>

I wonder if anyone knows how to use Win32 to automate a keystroke using  
Ruby?

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [July 25, 2009, 12:47am UTC](https://www.ruby-forum.com/t/how-to-automate-keystroke-using-ruby/172621/2 "2009-07-25T00:47:14Z")

</div>

Jian L. wrote:

> I wonder if anyone knows how to use Win32 to automate a keystroke using  
> Ruby?

Is this what you are looking for?

> **[Automating Applications with Ruby & The Windows Script Host](http://rubyonwindows.blogspot.com/2007/05/automating-applications-with-ruby.html)**
>
> We've talked at length about automating Windows applications through COM/OLE, using the win32ole library. But not all applications expose t...

Hth,

Siep
