Page 1 of 2

Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 11:47 am
by Hialmar
I have updated the SVN (a while ago in fact) with a visual keyboard display and keyboard mapping redefinition feature.

It works okay on OS X, Linux (even though the first time I compiled it - it didn't so maybe there is an hidden bug somewhere).

It doesn't work on Windows however and I have no idea why.
I'll try to have Oricutron to be built with visual studio so that I can debug it.
Using Mingw's gdb was very strange...

Anyway, if someone can test this it would be nice.

There is a new submenu called "Keyboard options".

In the submenu you can find:
- a toggle that shows/hides the visual keyboard (you can click on the keyboard keys to enter key presses/releases) ;
- a toggle that gets you in the key mapping definition mode (you can then click on a visual keyboard key ; press a real key on your keyboard and the mapping will work) ;
- a toggle that allows mod keys (ctrl, shift, funct) to be sticky (ie you first click on a key to press it and then either re-click it to release it or click on another key and it will generate a modded key press - e.g. a Ctrl-T instead of T - and then auto release the key) ;
- an option to save a keyboard mapping (.kma file) ;
- an option to load a keyboard mapping ;
- an option that resets the keyboard mapping to the default SDL one.

You can also add the following in your oricutron.cfg to autoload a keyboard mapping (here Test.kma in the keymap directory found in Oricutron's directory):

Code: Select all

; automatically load a keyboard mapping file
autoload_keyboard_mapping = 'keymap/Test.kma'
If someone could test this it would be nice.
Also if someone finds why this doesn't work under Windows it would be even nicer ;)

PS : the visual keyboard isn't working correctly on the Pravetz 8D but I have trouble understanding some of the keys... Any help with this is more than welcome as I don't have a pravetz 8D.

Re: Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 12:00 pm
by iss
Nice feature! I will check asap in Linux and 8D related items :).

Re: Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 3:32 pm
by Xeron
good work! And potentially useful for an android port :)

Re: Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 4:40 pm
by iss
indeed! It's ready for touch screens :).

Re: Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 6:28 pm
by Xeron
I've commited a fix for problems that showed up on my linux laptop. I haven't had time to test it on my Windows laptop or Amiga, but I suspect it might be fixed.

Re: Visual keyboard for Oricutron

Posted: Fri Mar 28, 2014 10:54 pm
by Hialmar
Ah ok the problem was due to the fact that you can click on a visual key, move the mouse in another key and release the mouse button ?

Your fix, actually breaks the sticky mod keys management.

I'll try to re-think this a bit.

Anyway you can still press shift/ctrl/func while clicking on a visual key.

Edit: I have found a fix for this.

Re: Visual keyboard for Oricutron

Posted: Sat Mar 29, 2014 9:26 am
by Xeron
The change I committed also fixed a weird crash. You were reading off the end of the modkey array. I have no idea why that caused a crash, but on Ubuntu, with optimisation turned on, this generated a weird crash with an illegible stack backtrace in gdb. Turning off optimisation made the problem go away. I have no idea why it caused such behaviour, but fixing the bug fixed the crash. I think it was the same crash and gdb weirdness you saw on Windows.

Re: Visual keyboard for Oricutron

Posted: Sat Mar 29, 2014 12:22 pm
by Hialmar
Yes it sounds exactly the problem I saw.

Sorry for the problem.

Re: Visual keyboard for Oricutron

Posted: Sat Mar 29, 2014 2:00 pm
by Dbug
I don't want to be annoying, but would be nice if you did not both have the same visual avatar, makes it harder to follow the discussions :)

Re: Visual keyboard for Oricutron

Posted: Sat Mar 29, 2014 4:16 pm
by Hialmar
Okay I'm a Telestrat now ;)

And the windows version works okay now :)
I just compiled it on Win7.

I have quickly done a little keymap that transforms the qwerty into an azerty keyboard ;)

Re: Visual keyboard for Oricutron

Posted: Tue Apr 01, 2014 7:59 am
by Hialmar
One of my next work will be to modify the pravetz 8D keymap to make it work as intended.

But it's very different than the Atmos' one so I suppose I'll need to modify the keyboard matrix as well isn't it ?
Or am I missing something ?

Re: Visual keyboard for Oricutron

Posted: Tue Apr 01, 2014 8:03 am
by Dbug
Hialmar wrote:One of my next work will be to modify the pravetz 8D keymap to make it work as intended.

But it's very different than the Atmos' one so I suppose I'll need to modify the keyboard matrix as well isn't it ?
Or am I missing something ?
The Pravetz keyboard is 100% identical to the Atmos one.
The only difference in behavior is that the FUNC key of the atmos is now behaving like what CTRL-T does, it's a CAPS LOCK key.

Re: Visual keyboard for Oricutron

Posted: Tue Apr 01, 2014 7:47 pm
by iss
I fixed Pravetz 8D visual keyboard and all keys work as expected.
Additionally added two new options in 'oricutron.cfg' file:
; Visual keyboard
show_keyboard = yes
sticky_mod_keys = yes

If set - Oricutron starts with Visual keyboard shown :).

Re: Visual keyboard for Oricutron

Posted: Tue Apr 01, 2014 8:07 pm
by Hialmar
Ah very good. Thanks a lot :)

Re: Visual keyboard for Oricutron

Posted: Tue Apr 01, 2014 8:12 pm
by Hialmar
I'll update the OS X downloadable 1.1 version with all this or should we call it 1.2 ?

I suppose that it's your say Xeron ?