Jump to content
IDU

Shift key stuck plz help me!

Recommended Posts

IDU

I’m using autoit3 for make keyrep software, it look like if “s” key pressed after “a” then Unicode send 0241.

I’m done everything ok, but only one thing gone error the shift key. In holding down the shift key first send uppercase but secondly it send lower case. Can anyone fix this? I already done

Send("{SHIFTDOWN}{SHIFTUP}") but it doesn’t work for me. My code is (limited edition)

Opt("SendCapslockMode", 0)
Global $hotkeynum
SelectKey();firstly runing func
Func SelectKey()
   While True
      HotKeySet("{a}","sima")
      HotKeySet("{A}","capA")
      HotKeySet("{s}","sims")
      HotKeySet("{S}","capS")
      Sleep(50)
   WEnd
EndFunc
;~ DesableFunction//////////////
Func desableallkey()
   HotKeySet("{a}")
   HotKeySet("{A}")
   HotKeySet("{s}")
   HotKeySet("{S}")
EndFunc
;~ End Main Function//////////////////////////////////////////////////////
;~ Main Function Calling Functions////////////////////////////////////////
func sima()
      $hotkeynum = 1
      desableallkey()
      Send("a")
      SelectKey()
EndFunc
func capA()
      $hotkeynum = 1
      desableallkey()
      Send("A")
      SelectKey()
EndFunc
func sims()
   If $hotkeynum = 0  Then
      desableallkey()
      Send("{BS}{ASC 0241}"); 0241 =ñ ,0242=ò
   Else
      desableallkey()
      Send("{BS}{ASC 0242}")
      EndIf
      SelectKey()
EndFunc
func capS()
   If $hotkeynum = 0  Then
      desableallkey()
      Send("{BS}{ASC 0242}")
   Else
      desableallkey()
      Send("{BS}{ASC 0241}")
      EndIf
      SelectKey()
EndFunc

 

 

test - key.au3

Edited by IDU
text missing

Share this post


Link to post
Share on other sites
reb

check the help file for send.

especially this part

"To hold a key down
    Send("{a down}") ;Holds the A key down
    Send("{a up}") ;Releases the A key"

send(" {ENTER up}") might do.

your link test - Copy - Copy.au3

is not working for me so this is just a guess.

good luck

 

Edited by reb
  • Like 1

MEASURE TWICE - CUT ONCE

Share this post


Link to post
Share on other sites
IDU

thanks reb for reply me.

but its not what i looking for. now my link is work, you can check it for revise my code.

Share this post


Link to post
Share on other sites
Jos

You code is flawed as it never returns from any functions and your while loop is setting the hotkeys constandly.

As this remark from the Helpfile is important:

It is recommended to use lower-case keys/characters (e.g. "b" and not "B") when setting hotkeys to avoid errors as with some keyboard layouts upper and lower case keys may be mapped differently.

Jos

 

ps: Posting in this support forum implies you need help so no need to put that in the title!

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
IDU

You code is flawed as it never returns from any functions and your while loop is setting the hotkeys constandly.

As this remark from the Helpfile is important:

Jos

 

ps: Posting in this support forum implies you need help so no need to put that in the title!

Thanks jos for replying.

Firstly I’ll remove “plz help me!” from my next topic.

Secondly you said that hot keys are constandly, but they aren’t constandly. 

There is a function to disable hot keys (desableallkey()). 

But it is true that never return from function. 

But it not necessary to return from loops and there was a code to detect upper and lower case.

( Opt"SendCapslockMode", 0)

 

Edited by IDU

Share this post


Link to post
Share on other sites
jchd

You need to carefully reread what Jos told you.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with 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

  • Similar Content

    • Zein
      By Zein
      #include "..\Include\Array.au3" #include "..\Include\File.au3" #include "..\Include\AutoItConstants.au3" Local $aRetArray Local $sFilePath = "n.csv" _FileReadToArray($sFilePath, $aRetArray, ",") ; _FileReadToArray($sFilePath, $aRetArray, $FRTA_COUNT, ",") _ArrayDisplay($aRetArray, "Original", Default, 8) The above code shows two versions of _FileReadToArray and both don't work as expected.
      The first one doesn't use the comma as a delimiter. (so I get a single column array)  I tried adding "Default" between $aRetArray and "," then it told me it had an incorrect number of parameters. 

      I looked again at the documentation:
       
      #include <File.au3> _FileReadToArray ( $sFilePath, ByRef $vReturn [, $iFlags = $FRTA_COUNT [, $sDelimiter = ""]] )
      And I with or without the flags params I should be getting a 2D array due to my file being a csv. 
      I then tried a regular flag, $FRTA_COUNT, and it tells me that I'm using a variable $FRTA_COUNT while it's not declared. Tried putting in 1 instead and it told me again, incorrect number of params. 

       
    • nooneclose
      By nooneclose
      I need to perform a subtotal in excel and I would like to automate this process using Autoit if possible like always any and all help will be greatly appreciated. 
      I can not find a good example but the two from Microsoft. Here is one of the two from msdn.microsoft.com/en-us/vba/excel-vba/articles/range-subtotal-method-excel
      I do not really understand how to translate this into AutoIt, but I gave it a try and here is what I have.
      $OpenRange      = "A1:E200" $xlSum          = -4157 $Added_Array[2] = [2, 3] $OpenRange.Subtotal("B1", $xlSum, $Added_Array, True, False, True) I just need to perform a subtotal on a range based on a header called department, and then perform a sum on the results.
    • nooneclose
      By nooneclose
      How to use _Excel_RangeSort to sort my excel file by three different headers Column A1, B1, and C1 have headers on which I want to sort by. The headers on which I want to sort are department, employee type, and name.
      I still really new to AutoIt so I do not actually know how to properly start this line or lines of code, to be honest. The example code is the best I can do.
      _Excel_RangeSort($OpenWorkbook, Default, "A1:C1", "1:1", $xlDescending, Default, $xlYes, Default, $xlSortRows) I just need to sort by those three headers in that order of department, employee type, and name, plus in descending order.
       
      any and all help would be greatly appreciated.  Thank you!
    • Eminence
      By Eminence
      Hello,
      Using SQLite, I was trying to select a specific column with having duplicate entries removed by using the DISTINCT function. 
      Local $sQuery = "SELECT DISTINCT supervisor, COUNT(DISTINCT employee_name) FROM data_db What the above snippet does is just list only one supervisor but with the total count of unique employee names in the whole database when it should be listing out all supervisor entries from the database and list the total count of employees per each supervisors. If I remove the COUNT function, it does list out all unique entries of supervisor names from the list. Attached is a screenshot of an example database as well. 
      Any help will be much appreciated. Thank you!

    • PramodR
      By PramodR
       
      I see couple of ways to import module ,  one with specifying absolute path of the file to get imported, by this logic i believe to import a specific module will be like #include <c:\modulepath\duplicatemodule.au3>
      but i see some registry changes also made in this link , can someone explain why that registry change is really required.
       
×