Jump to content

_IsPressed Key combo possible ?


caramen
 Share

Recommended Posts

I am trying to record a ClipGet after Ctrl + C Is stroke.

Not working. It is possible ? 

While (1)
   $msg = GUIGetMsg ()
   Switch $msg
         Case $GUI_EVENT_CLOSE
            Exit
   EndSwitch
   Local $hDLL = DllOpen("user32.dll")
   If _IsPressed ("A2",$hDLL) And _IsPressed ("56",$hDLL) Then
      Sleep (500)
      $ClipBoard = ClipGet ()
;~ ==========================================Console============================================
      _GUICtrlListView_AddItem($ConsoleArea,""&$ClipBoard)
      _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1)
;~ =========================================/Console============================================
   EndIf
   DllClose ($hDLL)
WEnd

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I tryed by random idea... It is working with the + 

Lol... Dont expected a working code ... *

If _IsPressed ("A2",$hDLL) + _IsPressed ("56",$hDLL) Then

Rectification : 

 

It is now registering my clipget with the CTRL key and CTRL + C 

How to remove the fact that CTRL alone record my ClipGet :o ?

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

;Tryed that... 
   Local $hDLL = DllOpen("user32.dll")
   If _IsPressed ("A2",$hDLL) =1 Then
   EndIf
   If _IsPressed ("A2",$hDLL) =1 + _IsPressed ("56",$hDLL) =1 Then
      Sleep (1000)
      $ClipBoard = ClipGet ()
;~ ==========================================Console============================================
      _GUICtrlListView_AddItem($g_hListview,""&$ClipBoard)
      _GUICtrlListView_EnsureVisible($g_hListview, _GUICtrlListView_GetItemCount($g_hListview)-1)
;~ =========================================/Console============================================
   EndIf
   DllClose ($hDLL)

Oups thought i was editing sry.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Oh well it's working better when i am not stupid :D 

I set the wrong key .... 

 

Now it s working i use do...until if CTRL is down.

 

But may there is other solution ? 

While (1)
   $msg = GUIGetMsg ()
   Switch $msg
         Case $GUI_EVENT_CLOSE
            Exit
   EndSwitch
   Local $hDLL = DllOpen("user32.dll")
   If _IsPressed ("A2",$hDLL) =1 Then
      Do
         Sleep (50)
      Until _IsPressed ("43")
   EndIf
   If _IsPressed ("A2",$hDLL) =1 + _IsPressed ("43",$hDLL) =1 Then
      Sleep (500)
      $ClipBoard = ClipGet ()
;~ ==========================================Console============================================
      _GUICtrlListView_AddItem($g_hListview,""&$ClipBoard)
      _GUICtrlListView_EnsureVisible($g_hListview, _GUICtrlListView_GetItemCount($g_hListview)-1)
;~ =========================================/Console============================================
   EndIf
   DllClose ($hDLL)
WEnd

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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

×
×
  • Create New...