Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/01/2013 in all areas

  1. Another reason to prefer parameters to globals is that functions can be reused much more easily in other projects. That helps modularity to a great extend: you don't have to practice surgery to export functions and that favors grouping famillies in reuseable includes. But of course it isn't a strict rule to apply blindly and go away happy in all cases. For instance, writing a function taking 83 arguments is obviously a bad design in the first place.
    2 points
  2. Jos

    Assistance Request for Script

    I am sorry you have these issues, but prefer you sort them out in a different way than the proposed solution as this is against our forum rules. Jos
    1 point
  3. Here's a better idea, talk to him or seek outside help. Screwing around with his PC will only exacerbate your problem!
    1 point
  4. The virtual key code can be found in the _IsPressed function. And using Yashied's _WinAPI_MapVirtualKey function you can find the scan key code. The example shows with F13 as a hot key Send("{F13}") will trigger that hot key. Looking at _IsPressed Remarks, you will find the virtual key codes for F13 to F24. ;#Include "APIConstants.au3" ;#Include "WinAPIEx.au3" HotKeySet("{F13}", "ImagineryKey") ; From _IsPressed Function "0x7C" is virtual key code for F13 key. ConsoleWrite('Virtual-key code F13: 0x' & Hex(0x7C) & @CR) ConsoleWrite('Scan code F13: 0x' & Hex(_WinAPI_MapVirtualKey(0x7C, 0)) & @CR); $MAPVK_VK_TO_VSC = 0 ConsoleWrite("----------------------------" & @LF) ; From _IsPressed Function "0x14" is virtual key code for CAPS LOCK key. ConsoleWrite('Virtual-key code CAPS LOCK key: 0x' & Hex(0x14) & @CR) ConsoleWrite('Scan code CAPS LOCK key: 0x' & Hex(_WinAPI_MapVirtualKey(0x14, 0)) & @CR) ; $MAPVK_VK_TO_VSC = 0 Send("{F13}") Func ImagineryKey() ConsoleWrite("{F13} key pressed" & @LF) EndFunc ;==>ImagineryKey ; Copied from http://www.autoitscript.com/forum/topic/98712-winapiex-udf/page__st__280#entry930607 ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_MapVirtualKey ; Description....: Translates a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. ; Syntax.........: _WinAPI_MapVirtualKey ( $iCode, $iType ) ; Parameters.....: $iCode - The virtual key code or scan code for a key. How this value is interpreted depends on the $iType parameter. ; $iType - The translation to be performed. This value depends on the value of the $iCode parameter and can be ; one of the following values. ; ; $MAPVK_VK_TO_CHAR ; $MAPVK_VK_TO_VSC ; $MAPVK_VSC_TO_VK ; $MAPVK_VSC_TO_VK_EX ; ; Return values..: Success - A scan code, a virtual-key code, or a character value, depending on the above parameters. ; Failure - 0 and sets the @error flag to non-zero. ; Author.........: Yashied ; Modified.......: ; Remarks........: An application can use _WinAPI_MapVirtualKey() to translate scan codes to the virtual-key code constants ; $VK_SHIFT, $VK_CONTROL, and $VK_MENU, and vice versa. These translations do not distinguish between the left and ; right instances of the SHIFT, CTRL, or ALT keys. ; ; An application can get the scan code corresponding to the left or right instance of one of these keys by calling ; _WinAPI_MapVirtualKey() with uCode set to one of the following virtual-key code constants. ; ; $VK_LSHIFT ; $VK_RSHIFT ; $VK_LCONTROL ; $VK_RCONTROL ; $VK_LMENU ; $VK_RMENU ; ; Related........: ; Link...........: @@MsdnLink@@ MapVirtualKey ; Example........: Yes ; =============================================================================================================================== Func _WinAPI_MapVirtualKey($iCode, $iType) Local $Ret = DllCall('user32.dll', 'uint', 'MapVirtualKeyW', 'uint', $iCode, 'uint', $iType) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_MapVirtualKey #cs Output at console:- Virtual-key code F13: 0x0000007C Scan code F13: 0x0000000000000064 ---------------------------- Virtual-key code CAPS LOCK key: 0x00000014 Scan code CAPS LOCK key: 0x000000000000003A {F13} key pressed #ce
    1 point
  5. I created something similar a week ago. I went with the following... _Timer_SetTimer _Timer_KillTimer _Timer_GetIdleTime MouseGetPos MouseMove FireFox, You know I use WinAPIEx alot, but the other day I realised _WinAPI_GetIdleTime was already in the Timers UDF.
    1 point
  6. It's very good now; I like the improvements you have made: the pop-up caption works very well, the code option buttons are great.
    1 point
  7. trancexx

    FEN, SAN and PGN

    Code is obfuscated by nature. Somebody build a gui board. Great, really!
    1 point
×
×
  • Create New...