Jump to content

_IsPressed help detect single quote '


Recommended Posts

_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

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
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")

..... :(

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
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

 

Link to comment
Share on other sites

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

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
Share on other sites

  • Moderators

Chimp,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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.

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...