Search

Some Frustration

Updated: 6 days ago

This week I have been working on how to have the cursor move automatically and read the words aloud.


I tried looking for weighed algorithms for the mouse, but I mainly found research papers and not many examples, which made things a little difficult. So I moved from the "weighed" idea to the idea of using mouse hover. There is a built in function for this, but then I realized I still need to get the user to hover over a word for so long, which can be difficult.


In the gazepoint data stream, I called the sleep() function to help slow down the mouse speed, which helped a little bit with the control, but it still wasn't great.


Right now, this is my "pseudocode":

int newX;

bool word1Click = false;

if (abs(currentpos.x - testword1->Location.x) <= SOME VALUE && abs(currentpos.y - testword1->Location.y) <= SOME VALUE)

{ setCursorPos(testword1->Location.x, testword1->Location.y)

testword1->texttoSpeechfunction;

word1Click = true;}


if(word1Click == true)

{ for (int i = 0; i < pages; i++)

for(int j = 1; j < numwords; j++)

{array[i][j]->texttoSpeechfunction}

}

}

}

//in turn page function, word1Click = false;


I have not found a way to obtain the x and y coordinates of my textbox, which has been causing some problems with actually moving on with my code. The location is set by doing: testword1->Location = System::Drawing::Point(x, y) but I do not know how to pull from this, and cursorPos is of type POINT, so I do not know if System::Drawing::Point and POINT are able to have operands between them. But, my idea through this is if I can get my eyes close enough to the first word, then I can iterate through the array and have my book be automatically read to me.


Although, as I am writing this, I am realizing there may be an easier way... maybe I can do it so if I just click the first word via the space bar or the mouse, then that will trigger the reading... I may explore this option some more.



0 views0 comments