Sign in to follow this  
Followers 0
magace

_IsPressed help detect single quote '

11 posts in this topic

Making a keyboard tester for work and cant seem to figure out how to detect ' key

Any ideas?

Thanks!

Share this post


Link to post
Share on other sites



_ispressed('DE') is quote


Spoiler

I have no complaints.  I mean there are lots of things wrong with the world but I am not unhappy.
How could we ever fix it all, but to hope that one day we might?

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

_ispressed('DE')  does not work on German keyboards for quote.

This works on German keyboards.

#include <Misc.au3>
;~ _ispressed('DE')  does not work on German keyboards for quote.
;~ This works on German keyboards.
;~ Place the cursor after the #cs line, since the quote will be written there.
;~ Then press F5
;~ Press ESC to exit
Local $hDLL = DllOpen("user32.dll")

While 1
    If _IsPressed("1B", $hDLL) Then ExitLoop
;~     If _IsPressed("BF", $hDLL) _
;~             Then Beep(1800, 200)          ; if CAPS LOCK, use _WinAPI_GetKeyState() to check keystate

If _IsPressed("BF", $hDLL) And _         ; the key with hash and quote
            _IsPressed("10", $hDLL) And _    ; a shift key is pressed
            (_IsPressed("A1", $hDLL) or _    ; if left shift key
            _IsPressed("A0", $hDLL))  _      ; if right shift key
            Then Beep(1800, 200)
WEnd

DllClose($hDLL)
Beep(800, 200)

#cs
    Place the cursor after this line, since the Quote will be written there.



#ce
Enjoy

Edit: Fixed issue with left shift key

Check for CAPS LOCK not fixed.

Edited by Exit
1 person likes this

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

Not working here (italian keyboard)

this doesn't work:

_IsPressed("BF", $hDLL) And _IsPressed("10", $hDLL) And (_IsPressed("A1", $hDLL) Or _IsPressed("A0", $hDLL))

nor this:

_ispressed('DE')

and even this doesnt

_IsPressed("C0")

..... :(


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Depends on the keyboard language, the key is VK_OEM_X

Example basend on the result of this thread:

 

VK_OEM_3 0xC0
Used for miscellaneous characters; it can vary by keyboard.
For the US standard keyboard, the '`~' key
 
VK_OEM_7 0xDE
Used for miscellaneous characters; it can vary by keyboard.
For the US standard keyboard, the 'single-quote/double-quote' key

 

Just test the all the VK_OEM ( there are nine if i remember well ) and see what working for you.


Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

For the italian keyboard the right code for quote is "BF"

 

found it with this little snippet

 

put cursor in console output area and press F5 to run

then press the quote key to see the right code for your keyboard

<snip>

Edited by Melba23
Code removed

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Chimp,

Please read this announcement - the code you posted was in direct contravention of the "watch for all keys" prohibition. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Share this post


Link to post
Share on other sites

Chimp,

Please read this announcement - the code you posted was in direct contravention of the "watch for all keys" prohibition. :naughty:

M23

 

opsss

I am sorry :(

done without thinking and without bad intentions

I'll pay more attention next time.

Thanks for cleaning that code.


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0