Home › Forums › Software Development › VB.NET example code for Interactors
Tagged: developer
- This topic has 12 replies, 2 voices, and was last updated 6 years ago by Grant [Tobii].
- AuthorPosts
- 08/11/2018 at 00:28 #8997TWParticipant
Hello!
Can I get some VB.NET code along with the Interaction samples on GitHub that would show how to add custom regions (let’s say I draw a custom grid by code only and want each cell to be GazeAware) that can either be blink or dwell clicked (after some time)?
I find the GitHub Interaction samples extremely hard to understand with their Lambda functions.
I would need a simple, general sample, not already customized to Wpf or specific to WinForm events.
I think the Interaction Sample on GitHub really miss such a scenario, and the docs are really sparse on that.
That would make the Interaction Samples on GitHub more usable.
Thank you.
08/11/2018 at 14:07 #8999Grant [Tobii]KeymasterHi @tw2018 and thanks for your query. I am afraid that the Tobii Core SDK does not come with VB.Net samples available unfortunately. That being said, a number of other users have successfully converted the required C# code to by following the instructions as outlined in a similar thread on the forum which you can view @ https://developer.tobii.com/community/forums/topic/vb-net/
Indeed one of the users posted his final solution, so you can get the code to try out for yourself. In addition, you may find this documentation version @ https://tobii.github.io/CoreSDK/articles/getting_started.html more helpful in explaining how to setup interactors.
In case you did not already see the more simple sample applications, you can check them out @ https://github.com/Tobii/CoreSDK which perhaps can help you get started with the C# bindings as necessary.
Apologies we don’t have a sample ready for you, but hopefully the above links and information will provide the help you need. Please don’t hesitate to get in touch should you require any further assistance.
08/11/2018 at 23:30 #9000TWParticipantThat doesn’t help as it doesn’t represent a generic approach.
This (as the SDK examples) deal with WinForm controls.Even your C# GitHub samples don’t include a sample generic approach where one could simply define rectangles and IDs WITHOUT any controls.
14/11/2018 at 13:26 #9018Grant [Tobii]KeymasterHi @tw2018, thanks for your patience whilst we tried to find a solution appropriate for your needs. Did you get a chance to review the Minimal Core SDK samples @ https://github.com/Tobii/CoreSDK ?
If you download and run the “Interaction_Interactors_101” and “Interaction_Interactors_102” programs, we demonstrate the creation of a console based gaze aware windows with no WPF or Winforms loaded.. I think this should help you out?
When you do not work with WPF or WindowsForms, the Tobii Core SDK has UnboundInteractorAgent, which you can use to control everything related to interactors.
To help you manage interactors, the Tobii Core SDK provides another concept – InteractorAgents.Although the syntax is still C#, the documentation related to the underlying class “virtualinteractor” is further explained @ https://tobii.github.io/CoreSDK/api/Tobii.Interaction.VirtualInteractor.html
You should ideally be able to adapt the “currentWindowHandle” to a rectangle, although you didn’t mention upon which graphical system this rectangle is being drawn. In any event, please try these out and let us know how you get on.
14/11/2018 at 16:48 #9019TWParticipantOk. Regarding the example Interactors_102:
Let’s assume I have a window where I drew 10×10 buttons (none have a handle of their own, they’re just drawn onto the graphics of myWindowHandle).
1. Each button needs an InteractorAgent, which I would create using
var interactorsAgent = host.InitializeVirtualInteractorAgent(myWindowHandle, “MyWindow”);
Is that right?2. Should I do this for each button?
3. If yes, should I use an array of InteractorAgent for this?
4. What should I do when I (while running my application) delete the 10 buttons and draw 3 new buttons instead?
5. What should I do if I just want to tell Tobii that these are regions that it can click or stare? Is “.WithActivatable()” enough?
Thank you.
14/11/2018 at 22:44 #9021Grant [Tobii]KeymasterHi @tw2018, I think the easiest step now is if you could kindly share this VB.Net project you are working on via Github (or similar). Thereafter it should be easier to understand how we can help you get up and running. Thanks.
16/11/2018 at 15:47 #9024TWParticipantWell, with your help (you stated that interactors_102 does what I need) and some language conversion I managed to do it.
Once you know how to do it, it’s actually quite simple.I could swear I saw some example code on how to start a re-calibration for the current user profile.
I went through the Core SDK samples on GitHub, but I just don’t find it anymore.I need a code example on how to do this:
EyeXFramework.EyeXHost.LaunchGuestCalibration()
Also, I’m not sure if LaunchGuestCalibration is what I need.
I don’t want to re-calibrate the guest but the current user (profile).Also,
Can you tell me where that example code might be located that I once saw?16/11/2018 at 15:58 #9025TWParticipantStop!
I got it:
Dim c As New EyeXFramework.EyeXHost
c.LaunchRecalibration()16/11/2018 at 16:06 #9026TWParticipantFor the interactors, I need this:
_host1 As Tobii.Interaction.Host
For the calibration, I need this:
_host2 As EyeXFramework.EyeXHost
Should I use both??
16/11/2018 at 16:55 #9027TWParticipantAlso, can you tell me why EyeTrackingDeviceStatus returns INVALID and why it doesn’t connect?
My code is this:
Dim c As New EyeXFramework.EyeXHost
c.Start() ‘That is enough to connect, right?
Debug.Print(c.EyeTrackingDeviceStatus.ToString) ‘Returns “INVALID”
c.WaitUntilConnected(New TimeSpan(0, 10, 0)) ‘It doesn’t connect even though I wait quite a few minutes…
Dim b As Boolean = c.LaunchRecalibration() ‘Isn’t hit16/11/2018 at 22:43 #9028TWParticipantWell, calibration starts now.
19/11/2018 at 11:10 #9032Grant [Tobii]KeymasterHi @tw2018, very glad to hear that you are progressing well on this Visual Basic project!
Unless you have confidentiality issues to consider, it would be very much appreciated if you could indeed share the code for the benefit of other users and to better support any further issues you may have.
Am I correct to assume you have things up and running correctly now?
29/11/2018 at 10:41 #9049Grant [Tobii]KeymasterHi @tw2018, we were wondering how you were progressing on this project and if ultimately you would be able to share your results?
Many thanks for your contribution.
- AuthorPosts
- You must be logged in to reply to this topic.