ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GetKeyBoardState Function (https://www.excelbanter.com/excel-programming/439691-getkeyboardstate-function.html)

Jeff

GetKeyBoardState Function
 
Greetings,
I am working on a function to see if Ctrl + S is pressed. Useing the
GetKeyboardState Function is it possible to retirve this information? Also
What I have written crashes excel any ideas what i'm missing?


Dim anArray
Dim Result As Long

On Error GoTo HandleError

anArray = Array(VK_CONTROL, VK_S)

Result = GetKeyboardState(anArray(0))

Dave Ramage

GetKeyBoardState Function
 
Chip Pearson has a page on this, but using GetKeyState API function:
http://www.cpearson.com/excel/KeyTest.aspx

Cheers,
Dave

"Jeff" wrote:

Greetings,
I am working on a function to see if Ctrl + S is pressed. Useing the
GetKeyboardState Function is it possible to retirve this information? Also
What I have written crashes excel any ideas what i'm missing?


Dim anArray
Dim Result As Long

On Error GoTo HandleError

anArray = Array(VK_CONTROL, VK_S)

Result = GetKeyboardState(anArray(0))



All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com