[AccessD] Windows Key - ASCII Code - OT

MartyConnelly martyconnelly at shaw.ca
Wed Mar 9 12:55:54 CST 2005


Ahh they moved the list of Virtual Key Codes again
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
I believe these are also listed in VB6 Help files.
There are intrinsic Access keyboard constants in help file or you can 
find in object browser
like vbKeyCancel or  vbKeyA but it is incomplete list and does not 
include odd keys like Hangul IME.or Windows

Nicholson, Karen wrote:

>This is what I needed.  Thank you.  I was googled out on this one.
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of MartyConnelly
>Sent: Tuesday, March 08, 2005 2:54 PM
>To: Access Developers discussion and problem solving
>Subject: Re: [AccessD] Windows Key - ASCII Code - OT
>
>
>Here is how I do it
> The constant is VK_LWIN so it is hex 5B  some keyboards have two 
>windows buttons
>
>Private Const VK_LWIN = &H5B   'Left window button
>Private Const VK_RETURN = &HD  'ENTER key
>Private Const VK_SHIFT = &H10 'SHIFT key
>Private Const VK_CONTROL = &H11 'CTRL key
>Private Const VK_MENU = &H12 'ALT key
>Private Const VK_PAUSE = &H13 'PAUSE key
>Private Const VK_CAPITAL = &H14 'CAPS LOCK key
>Private Const VK_SNAPSHOT = &H2C  'Print Screen
>Private Const VK_APPS = &H5D
>         'Applications key on a Microsoft Natural Keyboard
>'from http://support.microsoft.com/view/dev.asp?kb=242971
>
>Const GW_HWNDFIRST = 0
>Const GW_HWNDNEXT = 2
>Private Const KEYEVENTF_KEYUP = &H2
>
>Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
>    ByVal bScan As Byte, ByVal dwflags As Long, ByVal dwExtraInfo As
>Long)
>Sub OpenWindowsHelp()
>' Open the Windows Help  Windows - F1
>'
>' You can use the same technique to programmatically "press" any other
>' key, including Shift, Ctrl, Alt and keys combinations that can't be
>' simulated through SendKeys
>'vbKey constants partially definined in Access Help
>    ' programmatically press the Windows key
>    keybd_event VK_LWIN, 0, 0, 0
>    ' then press and then release the F1 key
>    keybd_event vbKeyF1, 0, 0, 0
>    keybd_event vbKeyF1, 0, KEYEVENTF_KEYUP, 0
>    ' and finally release the Windows Key
>    keybd_event VK_LWIN, 0, KEYEVENTF_KEYUP, 0
>End Sub
>
>Sub CloseAllWindows()
>' Minimize all open windows Windows-M
>'Const acaltMask
>    ' programmatically press the Windows key
>    keybd_event VK_LWIN, 0, 0, 0
>    ' then press and then release the M key
>    keybd_event vbKeyM, 0, 0, 0
>    keybd_event vbKeyM, 0, KEYEVENTF_KEYUP, 0
>    ' and finally release the Windows Key
>    keybd_event VK_LWIN, 0, KEYEVENTF_KEYUP, 0
>End Sub
>
>Nicholson, Karen wrote:
>
>  
>
>>Maybe I should say, how do I program in Access, what is the shortcut,
>>like [page up], etc.
>>
>>-----Original Message-----
>>From: accessd-bounces at databaseadvisors.com
>>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Nicholson,
>>Karen
>>Sent: Tuesday, March 08, 2005 2:18 PM
>>To: accessd at databaseadvisors.com
>>Subject: [AccessD] Windows Key - ASCII Code - OT
>>
>>
>>Anyone know what the ASCII code is to invoke the functionality that is
>>provided by the Windows key (the little flying window) on the keyboard?
>> 
>>
>>    
>>
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada





More information about the AccessD mailing list