#184 Work towards widget virtual keyboard

open
nobody
None
5
2013-01-01
2008-08-21
No

It would be desirable to have some sort of virtual keyboard available in the widget UI in order to make Fuse more usable on console type devices without keyboards (or on computers with a joystick attached).

The attached patch is adapted from FuseX and draws a keyboard image when the Virtual Keyboard menu is selected and allows a highlight to be moved about the keyboard.

It is very rough as I have just rudely extracted the code from FuseX and wedged it into the widget UI, and it currently just lets you move the cursor around the image.

This keyboard could have a role in selecting the correct button mapping for joysticks in the widget UI, possibly in selecting the key mapping to use for the keyboard joystick and of course selecting keys ad hoc when the emulation is running.

I don't have much time to progress this at the moment, so I am putting up this patch in the hope that it may be inspirational or useful for anyone else to look at, improve or comment on.

Discussion

  • Marek Januszewski

    Logged In: YES
    user_id=609236
    Originator: NO

    it crashed for me on win32 + sdl. I hit F1, scroll down to Virtual keyboard and hit enter on it

    Program received signal SIGILL, Illegal instruction.
    ---Type <return> to continue, or q <return> to quit---
    0x004daf79 in menu_vert_external_margin ()
    (gdb) bt
    #0 0x004daf79 in menu_vert_external_margin ()
    #1 0x0041b2a1 in widget_do (which=WIDGET_TYPE_QUERY_SAVE, data=0x0)
    at widget.c:519
    #2 0x0041b2a1 in widget_do (which=WIDGET_TYPE_MEMORYBROWSER, data=0x4d1370)
    at widget.c:519
    #3 0x0041b2a1 in widget_do (which=WIDGET_TYPE_FILESELECTOR, data=0x3dd5f8)
    at widget.c:519
    #4 0x0041b2a1 in widget_do (which=5051248, data=0xd) at widget.c:519
    #5 0x0041b2a1 in widget_do (which=2292336, data=0x4) at widget.c:519
    #6 0x0041b2a1 in widget_do (which=WIDGET_TYPE_MEMORYBROWSER, data=0x30)
    at widget.c:519
    #7 0x0041b2a1 in widget_do (which=2292464, data=0x68bd6aa0) at widget.c:519
    #8 0x0041b2a1 in widget_do (which=1757244064, data=0x10b) at widget.c:519
    #9 0x0041b2a1 in widget_do (which=2292528, data=0x4149c0) at widget.c:519
    #10 0x0041b2a1 in widget_do (which=WIDGET_TYPE_FILESELECTOR, data=0x3de3e0)
    at widget.c:519
    #11 0x0041b2a1 in widget_do (which=4017480, data=0x3de3e0) at widget.c:519
    #12 0x0041b2a1 in widget_do (which=WIDGET_TYPE_FILESELECTOR, data=0x0)
    at widget.c:519
    #13 0x0041b2a1 in widget_do (which=4194304, data=0x3d27e0) at widget.c:519
    #14 0x0041b2a1 in widget_do (which=4007904, data=0x3d2a68) at widget.c:519
    #15 0x0041b2a1 in widget_do (which=WIDGET_TYPE_FILESELECTOR, data=0x22e7c4)
    at widget.c:519
    ---Type <return> to continue, or q <return> to quit---
    #16 0x0041b2a1 in widget_do (which=4199136, data=0xffffffff) at widget.c:519
    #17 0x0041b2a1 in widget_do (which=WIDGET_TYPE_FILESELECTOR, data=0x7ffdf000)
    at widget.c:519
    #18 0x0041b2a1 in widget_do (which=4294967294, data=0x9) at widget.c:519
    #19 0x0041b2a1 in widget_do (which=2088857568, data=0x0) at widget.c:519
    Previous frame inner to this frame (corrupt stack?)

     
  • Fredrick Meunier

    Logged In: YES
    user_id=11017
    Originator: YES

    Thanks, I managed to miss part of the patch, this one works for me.
    File Added: virtualkeyboard_2.patch

     
  • Marek Januszewski

    Logged In: YES
    user_id=609236
    Originator: NO

    looks cool!

    if this is going to be used whenever ui uses the widget I guess the menu in menu_data.dat should be within ifdef:
    #ifdef USE_WIDGET
    Virtual _Keyboard..., Item
    #endif

    Also hitting enter is commented out - I'm guess that intentional for now

     
  • Fredrick Meunier

    Logged In: YES
    user_id=11017
    Originator: YES

    The menu is just a placeholder to see the keyboard which is why there is no ifdef, enter is commented out as they keyboard code is not developed to the point yet, and the code is very messy. As I said I won't have the opportunity to work on this for some time so I wanted to get it out there in case someone else was inspired to push it forward over the next month or so.

     

Log in to post a comment.