Guest User

Untitled

a guest
Mar 16th, 2025
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance force
  2. Esc::ExitApp
  3. *$3::
  4. *$7::
  5. *$0::
  6. *$a::
  7. *$b::
  8. *$c::
  9. *$d::
  10. *$e::
  11. *$f::
  12. *$g::
  13. *$h::
  14. *$i::
  15. *$j::
  16. *$k::
  17. *$l::
  18. *$m::
  19. *$n::
  20. *$o::
  21. *$p::
  22. *$q::
  23. *$r::
  24. *$s::
  25. *$t::
  26. *$u::
  27. *$v::
  28. *$w::
  29. *$x::
  30. *$y::
  31. *$z::
  32. *$Tab::
  33. *$`::
  34. *$`;::
  35. *$'::
  36. *$Enter::
  37. *$-::
  38. *$=::
  39. *$,::
  40. *$.::
  41. *$/::
  42. *$\::
  43. *$[::
  44. *$]::
  45. *$CapsLock::
  46. *$Backspace::
  47. key_dict        := {"*$3":"3","*$7":"7","*$0":"0","*$a":"a","*$b":"b","*$c":"c","*$d":"d","*$e":"e","*$f":"f","*$g":"g","*$h":"h","*$i":"i","*$j":"j","*$k":"k","*$l":"l","*$m":"m","*$n":"n","*$o":"o","*$p":"p","*$q":"q","*$r":"r","*$s":"s","*$t":"t","*$u":"u","*$v":"v","*$w":"w","*$x":"x","*$y":"y","*$z":"z","*$Tab":"{Tab}","*$``":"``","*$;":"`;","*$'":"'","*$Enter": "{Enter}" ,"*$-":"-","*$=":"=","*$,":",","*$.":".","*$/":"/","*$\":"\","*$[":"[","*$]":"]","*$CapsLock": "{CapsLock}" }
  48. sorted_key_list := ["1","!","2","@","3","4","$","5","%","6","^","7","8","*","9","(","0","q","Q","w","W","e","E","r","t","T","y","Y","u","i","I","o","O","p","P","a","s","S","d","D","f","g","G","h","H","j","J","k","l","L","z","Z","x","X","c","C","v","V","b","B","n","N","m","M"]
  49. special_key_dict:= {"{Backspace}": "Z", "{Tab}": "I","{Enter}": "G", "{CapsLock}": "D","-": "%","=": "$","[": "W","]": "O","`;": "S","'": "H","\": "T",",": "^",".": "P","/": "Q","``":"6"}
  50. special_key_list:= ["{Backspace}", "{Tab}","{Enter}","{CapsLock}","-","=","[","]","`;","'","\",",",".","/","``"]
  51.  
  52. key_signature := 0
  53.  
  54. associated_key := key_dict[A_ThisHotKey]
  55.  
  56. if (GetKeyState("Shift", "P"))
  57. {
  58.     ;MsgBox, associated_key %associated_key%
  59.    
  60.     ; Does this key exist, if it does, give me the index
  61.     special_key_index := GetIndex(special_key_list, associated_key)
  62.    
  63.     ;MsgBox, special_key_index %special_key_index%
  64.     ; Is the associated key a special one?
  65.     if (special_key_index != -1)
  66.     {
  67.         ; Find which key the special key maps to
  68.         special_key := special_key_list[special_key_index]
  69.        
  70.         ;MsgBox, special_key %special_key%
  71.        
  72.         special_key_match := special_key_dict[special_key]
  73.        
  74.         ;MsgBox, special_key_match %special_key_match%
  75.        
  76.         ; Find the matched key's index in the sorted list
  77.         sorted_key_list_index := GetIndex(sorted_key_list, special_key_match)
  78.        
  79.         ;MsgBox, sorted_key_list_index %sorted_key_list_index%
  80.        
  81.         ; Move it up one since we're holding shift
  82.         special_key_next := sorted_key_list[sorted_key_list_index + key_signature + 1]
  83.        
  84.         ;MsgBox, special_key_next %special_key_next%
  85.        
  86.         if (special_key_next = "^")
  87.         {
  88.             special_key_next:="6"
  89.         }
  90.         else if (special_key_next = "$")
  91.         {
  92.             special_key_next:="4"
  93.         }
  94.         else if (special_key_next = "%")
  95.         {
  96.             special_key_next:="5"
  97.         }
  98.         else if (special_key_next != "7" and special_key_next != "6" and special_key_next != "5")
  99.         {
  100.             special_key_next := sorted_key_list[sorted_key_list_index + key_signature + 2]
  101.         }
  102.        
  103.         Send %special_key_next%
  104.     }
  105.     ; This is probably a normal key
  106.     else
  107.     {
  108.         normal_key_index := GetIndex(sorted_key_list, associated_key)
  109.        
  110.         ; If this key exists
  111.         if (normal_key_index != -1)
  112.         {
  113.             ; Find the next key with the associated index
  114.             key_next := sorted_key_list[normal_key_index + key_signature + 1]
  115.            
  116.             Send %key_next%
  117.         }
  118.     }
  119. }
  120. else
  121. {
  122.     ; Does this key exist, if it does, give me the index
  123.     special_key_index := GetIndex(special_key_list, associated_key)
  124.    
  125.     ; Is the associated key a special one?
  126.     if (special_key_index != -1)
  127.     {
  128.         ; Find which key the special key maps to
  129.         special_key := special_key_list[special_key_index]
  130.        
  131.         special_key_match := special_key_dict[special_key]
  132.        
  133.         ; Find the matched key's index in the sorted list
  134.         sorted_key_list_index := GetIndex(sorted_key_list, special_key_match)
  135.        
  136.         special_key := sorted_key_list[sorted_key_list_index + key_signature]
  137.  
  138.         if (special_key = "^")
  139.         {
  140.             special_key:="+6"
  141.         }
  142.         else if (special_key = "$")
  143.         {
  144.             special_key:="+4"
  145.         }
  146.         else if (special_key = "%")
  147.         {
  148.             special_key:="+5"
  149.         }
  150.         else
  151.         {
  152.             special_key := sorted_key_list[sorted_key_list_index + key_signature + 1]
  153.         }
  154.        
  155.         Send %special_key%
  156.     }
  157.     ; This is probably a normal key
  158.     else
  159.     {
  160.         normal_key_index := GetIndex(sorted_key_list, associated_key)
  161.        
  162.         ; If this key exists
  163.         if (normal_key_index != -1)
  164.         {
  165.             ; Find the key with the associated index
  166.             key := sorted_key_list[normal_key_index + key_signature]
  167.            
  168.             Send %key%
  169.         }
  170.     }
  171. }
  172.  
  173. GetIndex(haystack, needle)
  174. {
  175.     if !(IsObject(haystack)) || (haystack.Length() = 0)
  176.     {
  177.         return -1
  178.     }
  179.    
  180.     for index, value in haystack
  181.     {
  182.         if (value = needle)
  183.         {
  184.             return index
  185.         }
  186.     }
  187.    
  188.     return -1
  189. }
Advertisement
Add Comment
Please, Sign In to add comment