Request orientation to mod P300 Speller "keyboard"

Making & changing box plugins and external apps
Post Reply
entrity
Posts: 6
Joined: Thu Feb 08, 2018 7:11 pm

Request orientation to mod P300 Speller "keyboard"

Post by entrity »

I am attempting to made a mod of the P300 Speller Visualisation. I have spent a few days reading .cpp and .h files for it, but I am afraid that I have been unable to orient myself. Can anyone assist by suggesting what files or functions I must inspect to make the two changes that I wish:
  • Replace the existing "keyboard" (table of characters) with a custom one of different dimensions
  • Update the "keyboard" based on what the module's prediction is. (At present, the visualisation displays the predicted character in a field labelled "Results:" at the bottom of the window. It is this prediction that I wish to use.)
I am working with v1.3.0 for a class, and -- I am chagrined to report -- I have a week to deliver evidence that I can achieve my aim before the school term is out (late March).

Kind regards

-- TL;DR --

I have spent the most time with
  • plugins/processing/simple-visualisation/src/box-algorithms/ovpCBoxAlgorithmP300SpellerVisualisation.cpp
  • plugins/processing/simple-visualisation/src/box-algorithms/ovpCBoxAlgorithmP300SpellerVisualisation.h

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Request orientation to mod P300 Speller "keyboard"

Post by jtlindgren »

Hello again Entrity,

the P300 visualizer makes the GUI out of individual gtk elements. These elements are listed in the .ui file that the box loads at the startup. These .ui files are xml and can be either modified by a text editor (if you're skilled) or by using a tool called Glade. Basically the logic is such that the C++ code requests handles for these elements (such as a letter in the grid) and then does some operation on the handle such as changing the elements color or background. If I remember correctly, this is done often with kind of generic functions that loop over the grid and if the element matches a given criteria, some operation is carried out, otherwise something else. For example, highlight a letter if its to be flashed and otherwise set it to a black background.

So basically you need to either modify or add gtk elements during runtime. Its probably not very feasible to modify the .ui file runtime, so either you have all the possible elements there in the first place and just code in C++ when to show and when to hide what elements. Alternatively, you can use gtk code runtime to add new elements that are not in the ui file. Taking a look at the generic gtk programming tutorials/docs on the internet should help in this.

Hope this helps,
Jussi

entrity
Posts: 6
Joined: Thu Feb 08, 2018 7:11 pm

Re: Request orientation to mod P300 Speller "keyboard"

Post by entrity »

Thanks, Jussi.

Post Reply