Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

[LINUX] On-Screen Display / On-Screen Keyboard

Any and all A320 homebrew topics

Moderator: Moderators

[LINUX] On-Screen Display / On-Screen Keyboard

Postby torque on Sun Jun 07, 2009 7:28 pm

Hi!

I'm thinking about implementing some kind of frontend for dingoo linux.
For it's first incarnation I want to implement a On-Screen keyboard (for
things like dosbox / "emergency" terminal).

so, here's how I think it could work:

Basic use cases:

- user presses a button on the device for a short period of time =>
on-screen keyboard is displayed, exit by pressing same button
or clicking UI element
- user presses a button on the device for a long period of time =>
OSD comes up and allows user to start another emu, player, or
display some system statistics, exit s.a.

Implementation:

- implemented as a daemon which listens for input
- daemon brings up UI
- daemon emulates keypresses when a key on the OSK are pressed,
and thus forwards them to the emulator / player

Current state of affairs:

- got a simple demo program running in my development VM using
guichan http://guichan.sourceforge.net/
- planning to use http://code.google.com/p/xmlguichan/ for easy
customization
- there's also a GUI editor http://sourceforge.net/projects/gce
=> not yet evaluated
- I assume input is handled as a joystick device, so:
- tried out js2mouse http://freshmeat.net/projects/js2mouse/ in
order to emulate mouse events for guichan
=> this somewhat worked, but the curser was jumping around
randomly
options are:
- try to get js2mouse working by testing js2mouse / SDL settings
- patch the guichan SDL backend to react to joystick events
recommendation?

Open questions:

- is this a good idea?
- how can I simulate key presses? some linux guru might be able to answer
this more quickly than me spending hours googling ;)
SOLVED(?): http://www.einfochips.com/download/dash_jan_tip.pdf seems
to be the way to go
- who's going to draw me a nice GUI / OSK? :D (my artistic capabilities are
very limited and only surface randomly :))

Please discuss! :)

@moderator(s): maybe a linux subforum would be a good idea?
torque
 
Posts: 10
Joined: Sat Jun 06, 2009 8:48 pm
Location: Erfurt, TH, Germany

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby torque on Sun Jun 07, 2009 9:18 pm

UPDATE

uinput stuff seems to work. gonna start a basic daemon tomorrow.
it will probably also translate joystick to mouse events using uinput
for guichan.

also evaluated gui editor (not very thoroughly), seems very basic ...
also doesn't seem to use the same xml format as xmlguichan.
torque
 
Posts: 10
Joined: Sat Jun 06, 2009 8:48 pm
Location: Erfurt, TH, Germany

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby knk on Mon Jun 08, 2009 3:13 am

sounds good, great to see development. Keep it up =D
knk
 
Posts: 44
Joined: Mon May 25, 2009 8:56 am

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby torque on Mon Jun 08, 2009 8:45 am

knk wrote:sounds good, great to see development. Keep it up =D


Thank you for the encouragement. Exactly what I need (no irony here).

UPDATE

I'll probably use gpm in repeater mode for emulating a mouse. The uinput
way is not an option, since it does not emulate a mouse device (?!).

I fixed gpm's joystick support this morning, which seems to be broken for
years now. Still have to integrate time-based pointer acceleration and
button mapping (this is optional, and not a priority).

Cheers
torque
 
Posts: 10
Joined: Sat Jun 06, 2009 8:48 pm
Location: Erfurt, TH, Germany

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby welshmouse on Mon Jun 08, 2009 8:54 am

+1 encouragement.

its not much, but you do have my thanks. there are not enough people willing to do the work, so for devoting the time to this project, thankyou :)
welshmouse
 
Posts: 93
Joined: Sun May 03, 2009 3:54 am

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby eule on Mon Jun 08, 2009 10:11 am

Sounds awesome and lets me think of my old Amiga. :lol:
Anonymous said: is a fake.
Tobias said: it seems to run very slow ...so it could be real ...
Eläkeläiset - Humppa rules!
User avatar
eule
 
Posts: 170
Joined: Tue Apr 14, 2009 11:54 am

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby booboo on Mon Jun 08, 2009 4:24 pm

I'm not sure if there are enough applications that need a keyboard and are worth porting to the A320. At least not enough applications as to make the effort you're doing.

That said, I'm all for ANY application/tool/library that has the potential to draw developers and new apps to the A320, so here are my two cents:

- The input capabilities of the A320 are so minimal (as compared to a mouse or a full keyboard) that you must concentrate in making the keyboard FAST and easy to use. I don't think a mouse is the way to go here. I suggest a traslucent key matrix which you can navigate with up/down/left/right/start/select. Start could be ENTER and SELECT could be ESC. Speed could be improved by splitting the key matrix in two halves and make each selectable with the shoulder buttons.

- Having an emulated mouse would be great too for applications that need it but don't already emulate it with up/down/left/right.

- Either the on-screen keyboard is a library and programs are compiled against it, or you just CANNOT SHARE the framebuffer device. There are things like fbui, but programs must be modified to use it.

There are a couple of features I'm still to implement in the linux kernel for A320: volume and brightness control. Here I have two choices:

1- Do it all in the kernel.
2- Do it in user space (using uinput and the sound system and brightness control device).

Doing it all in the kernel is tempting: it is dead simple. You lose flexibility but the A320 is a very specialized system anyway. One thing that I would like to do is to show some overlay information on screen when you trun the volume or brightness up/down, and I faced the same sharing problem: I cannot show that info onscreen while another program is using the framebuffer. So I though I could do it all in kernel: keeping a double buffer in the framebuffer driver and do the overlay in software. It is an expensive operation in terms of cpu usage, but the overlay will be shown only a few seconds and whatever the user was doing he would have paused it to raise/lower the volume/brightness anyway.

Now I think your on-screen keyboard is also a great candidate to be implemented in a similar way. However, it implements a quite complex functionality and I don't think it should go in the kernel. So, what do we do?.

Here's a solution: I can modify the framebuffer driver so it creates TWO framebuffer devices. The first one would be the "standard" one, and the second would be the "traslucent overlay" one. The driver would "blend" both only when the second is in use.

Then, you can program a daemon that uses the traslucent overlay framebuffer and implements:

- On-screen keyboard.
- LCD brightness control.
- Audio volume control.

What do you think?
booboo
 
Posts: 8
Joined: Mon Apr 20, 2009 9:49 am

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby torque on Mon Jun 08, 2009 10:06 pm

booboo wrote:I'm not sure if there are enough applications that need a keyboard and are worth porting to the A320. At least not enough applications as to make the effort you're doing.


Applications I can think of: file managers, IM, web, etc (I'm kinda ambitious here, and I also have future / other devices in mind). :D It's also supposed to be a full-fledged UI for dingoo linux in the future, and implementing the KB (and your volume / brightness stuff) could serve as a basis for that.

booboo wrote:That said, I'm all for ANY application/tool/library that has the potential to draw developers and new apps to the A320, so here are my two cents:

- The input capabilities of the A320 are so minimal (as compared to a mouse or a full keyboard) that you must concentrate in making the keyboard FAST and easy to use. I don't think a mouse is the way to go here. I suggest a traslucent key matrix which you can navigate with up/down/left/right/start/select. Start could be ENTER and SELECT could be ESC. Speed could be improved by splitting the key matrix in two halves and make each selectable with the shoulder buttons.


This sounds like a really good idea, and I think we should go for it. We could reduce the matrix size even more by making the shoulder buttons "modifiers", and thus having a default mode (no shoulder button pressed) and 2 other modes for each shoulder button pressed, respectivly. This might be impracticable, though (even with only two modes).

booboo wrote:- Having an emulated mouse would be great too for applications that need it but don't already emulate it with up/down/left/right.


Yeah I have this working, only needs time-based input acceleration (curser moves faster the longer it moves). It uses gpm, and this might be little ankward, but it saves me from writing a mouse driver (and it will work on future devices, as long there is a joystick device). It also has the benefit of fixing a bug in gpm. ;)

booboo wrote:- Either the on-screen keyboard is a library and programs are compiled against it, or you just CANNOT SHARE the framebuffer device. There are things like fbui, but programs must be modified to use it.


Oh, I didn't know that the framebuffer could not be shared (though this was one of the things I had quietly feared ;)). I planned to do the input and all other stuff transparently to the applications, so that there are no modifications neccessary and developers can quickly port stuff. In the future we could provide a optional library which interfaces with the daemon, if we ever have any functionality in there worth exposing to applications (ATM I can't think of any, but I'm sure someone will come up with something :D).

booboo wrote:There are a couple of features I'm still to implement in the linux kernel for A320: volume and brightness control. Here I have two choices:

1- Do it all in the kernel.
2- Do it in user space (using uinput and the sound system and brightness control device).

Doing it all in the kernel is tempting: it is dead simple. You lose flexibility but the A320 is a very specialized system anyway. One thing that I would like to do is to show some overlay information on screen when you trun the volume or brightness up/down, and I faced the same sharing problem: I cannot show that info onscreen while another program is using the framebuffer. So I though I could do it all in kernel: keeping a double buffer in the framebuffer driver and do the overlay in software. It is an expensive operation in terms of cpu usage, but the overlay will be shown only a few seconds and whatever the user was doing he would have paused it to raise/lower the volume/brightness anyway.

Now I think your on-screen keyboard is also a great candidate to be implemented in a similar way. However, it implements a quite complex functionality and I don't think it should go in the kernel. So, what do we do?.

Here's a solution: I can modify the framebuffer driver so it creates TWO framebuffer devices. The first one would be the "standard" one, and the second would be the "traslucent overlay" one. The driver would "blend" both only when the second is in use.

Then, you can program a daemon that uses the traslucent overlay framebuffer and implements:

- On-screen keyboard.
- LCD brightness control.
- Audio volume control.



I think it should go into user-space. The second framebuffer sounds like a great idea. We can run SDL on top of it and use guichan without any modifications by just pointing it to the second FB, though I could imagine writing a special backend if neccessary.

Using guichan is overkill for these simple things, but some kind of UI library will be neccessary in the future. Also, if anybody knows a better, lightweight UI lib which runs on top of SDL / FB, please let me know. It seems decent enough though, and there already is a way to define UIs in xml , which will make skinning easy.

booboo wrote:What do you think?

I think this was some good input. :)
torque
 
Posts: 10
Joined: Sat Jun 06, 2009 8:48 pm
Location: Erfurt, TH, Germany

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby Gadgetoid on Mon Jun 08, 2009 10:36 pm

Give me an idea of what you need to skin and/or bung me a working binary with some rough placeholder graphics and I'll see what I can do.

I've got Dingoo Linux up and running, just waiting for something worthwhile to do with it!
Gadgetoid
 
Posts: 29
Joined: Mon Jun 01, 2009 9:22 pm

Re: [LINUX] On-Screen Display / On-Screen Keyboard

Postby torque on Tue Jun 09, 2009 12:02 pm

Gadgetoid wrote:Give me an idea of what you need to skin and/or bung me a working binary with some rough placeholder graphics and I'll see what I can do.

I've got Dingoo Linux up and running, just waiting for something worthwhile to do with it!


Cool. I'll get back to you when I have a prototype.

I had a closer look on the xml gui stuff and found out, that in order to support proper skinning,
I'll have to extend xmlguichan and patch guichan, so that every widget supports a bitmap background
(other option would be to derive own classes for each type of UI element). It currently doesn't have
priority, so don't expect it too soon. You could however make some mockup screens. Just read the
discussion above. Things we need:

- volume slider
- brightness slider
- keyboard as discussed above, either split in two or three pieces
- screens for selecting emulators / players
- some kind of file browser
- whatever you can imagine ... ;)

Place them wherever you like, but I think the underlying app should always be visible, so leave some
space at the borders or make it semi-transparent. If you need a sketch for the keyboard I can provide
one.
torque
 
Posts: 10
Joined: Sat Jun 06, 2009 8:48 pm
Location: Erfurt, TH, Germany

Next

Return to Homebrew

Who is online

Users browsing this forum: No registered users and 2 guests