Jump to content
Sign in to follow this  

An initiative to make focus control sound effects for the blind

Recommended Posts

Posted (edited)

I designed this code To help the blind
Where screen readers users can  Identify the sefocus  item with audio files
In this code i define some elements
Unfortunately, I did not know how to define the other elements
I am waiting for your initiative to  define the other elements
Thank you in advance

Global $CFocus = ""

Func focus($window)
    Local $focusing = ControlGetFocus($window)
    Local $handle = ControlGetHandle($window, "", $focusing)
    If Not ($focusing = $CFocus) Then
        Switch StringTrimRight($focusing, 1)
            Case "button"
                If IsCheckBox($handle) Then
                ElseIf IsRadio($handle) Then
                $CFocus = $focusing
            Case "comboBox", "ListBox"
                $CFocus = $focusing
            Case "edit", "input"
                $CFocus = $focusing
            Case Else
                $CFocus = $focusing

EndFunc   ;==>focus

Func IsCheckBox($ctrl_hwnd)
    $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)
    Return BitAND($Style, $BS_CHECKBOX) = $BS_CHECKBOX
EndFunc   ;==>IsCheckBox

Func IsRadio($ctrl_hwnd)
    $Style = _WinAPI_GetWindowLong($ctrl_hwnd, $GWL_STYLE)
EndFunc   ;==>IsRadio

Func play($name, $wait = 0)
    Local Const $SND_RESOURCE = 0x00040004
    Local Const $SND_ASYNC = 1
    ; Play the file - the script will pause as it sounds
    If $wait = 0 Then
        DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", BitOR($SND_RESOURCE, $SND_ASYNC))
        DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", $SND_RESOURCE)
    Return 1
EndFunc   ;==>play


Edited by nacerbaaziz
Added topic text and code tags

Share this post

Link to post
Share on other sites

Is there any help please

Share this post

Link to post
Share on other sites

You posted this in the Examples forum. You have been around long enough to know that if you're looking for help the thread should go in General Help and Support, and if you're looking to work collaboratively on a project it should go under AutoIt Projects and Collaboration. So which is it?

√-1 2^3 ∑ π, and it was delicious!

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
Sign in to follow this  

  • Similar Content

    • 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
      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.
    • fikri
      By fikri
      Hello to all.
      I would like to make automation for LabView compiled project exe.
      Actually I just need to get values (results) from labview textboxes. But since labview not using MS componenents, is that possible.
      I spend lot of time by googling and tried some scripts but without success.
      Is this possible at all? 
      Also, I cannot read text properties window by any spy tool?  
      here is what I have from AutoIt Info:
      Class: LVDChild
      Position: -8, -8
      Size: 1456, 876
      Style: 0x17CF0000
      ExStyle: 0x00040300
      Handle: 0x001F041C >>>> Control <<<<
      Advanced (Class): 
      ControlClick Coords: 
      Handle:  >>>> Mouse <<<<
      Position: 1256, 267
      Cursor ID: 0
      Color: 0xFAFAFA >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<<
      >>>> Hidden Text <<<<
    • toto22
      By toto22
      I have a string that look like this:

      WIFI    13.8    26.59
      BCRX    9.6    13.34
      GTES    8.5    11.15
      DFRG    5.9    33.02
      GIL    5.5    12.08
      How can I simply build an Array with it?