BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
660 stars 89 forks source link

Amiberry - virtual keyboard #224

Closed tukicat closed 1 year ago

tukicat commented 6 years ago

I have complied the "dev" version and I am doing a little testing with my my rpi3 and IPAC so I can provide a couple of Retroarch.cfg for IPAC users for your wiki.

I just wondered.......does Amiberry have a an option to display a virtual keyboard on screen?

midwan commented 6 years ago

@tukicat Not yet, but it's planned to be added in the near future. We already have sample code for it, but we haven't had time to implement it in Amiberry yet.

tukicat commented 6 years ago

Great thanks for the info. A while ago I helped Chui with virtual keyboard gfx for the UAE4ALL port for the Dingoo A320, I would be happy to help if there is anything you need for Amiberry.

midwan commented 6 years ago

@tukicat Fantastic, help in the project is always welcome! :) For now, the main focus is get things in order for the next stable release, so we can finally merge "dev" back into "master". Once that is done, we can start adding new features into "dev" again, so this will be one of them.

Let's keep this issue for future reference, and revisit it after the new version is out.

tukicat commented 6 years ago

No problem, happy to help when you are ready.

rsn8887 commented 6 years ago

ScHlAuChi also made some great keyboard images I used in UAE4All2 for Vita. If you are interested, here are the images: https://drive.google.com/open?id=1W9GCWUZl_cDjMFsUnLja5VTaNZLKPMv1

Here is an example of one of the keyboard images in use: Screenshot of UAE4All2 Vita_mod

ghost commented 6 years ago

That keyboard looks awesome! Hopefully it can be used (and with a bit of transparency so you can see what's going on). I also hope this can replace the Android one. Good job.

rsn8887 commented 6 years ago

The archive link I posted also includes a version with Shift depressed (capital letters etc) and versions for uk and German keymaps :)

HoraceAndTheSpider commented 6 years ago

we do already have a gfx in mind, but maybe it is something that could have several options (if the layout can be tabled in some way)

www.djcresswell.com/amigaonline/AmigaKeyboardPSP.png

ghost commented 6 years ago

I think @rsn8887 's would be better IMHO as it's clearer and can still be seen clearly with some transparency which will be vital when selecting keys as you can see the image underneath. That cropped photo of the Amiga keyboard looks like it's at an angle, you could have at least used a straight picture :)

HoraceAndTheSpider commented 6 years ago

The transparency would be added by the graphics drawing routine - should be no need to have it on the picture itself, so in theory anything could be used. It would be easy enough to have the transparency value adjustable, but these things shouldnt be judged until seen/tested anyway.

Used this one for years on another popular (portable) Amiga emulator, so no problem with the curve.
Not being rude, but I really dont think the other one looks very Amiga. It has more of an 8-bit feel.

As i said, it may be possible to have multiple options anyway.

rsn8887 commented 6 years ago

The 8bit feel of ScHlAuChi's keyboards I uploaded came from necessity: The image was made to fit into a 320*200 minimum screen resolution (the smaller the screen resolution, the faster the emulator).

tukicat commented 6 years ago

Hi, I am glad that there are some options for virtual keyboards on Amiberry. As I say a while ago I did the virtual keyboard for Chui's Dingoo A320 port of UAE4ALL, I believe it may also have been used for the Pandora port.

Completely by chance I was at friends and noticed he had an Armiga and the virtual keyboard on this is the same one I produced for the A320.

The virtual keyboard has a keyboard layout and when you hover the cursor over each key it shows and enlarged version to the side. However, I could make better version using the enlarged keys.

If you did want to use this, and I am by no way saying it is the best option, then I probably just need check with Chui that it is ok, as I produced it for his use some time ago.

image

CypherXG commented 6 years ago

specialkeyboard Here you can have my iAmiga Keyboard that i use for my iPad Amiga Emu. I don't need this anymore.

Darknior commented 6 years ago

WOAW i love it, please use this one <3

CypherXG commented 6 years ago

:-) Thx

Darknior commented 6 years ago

All keys are square, it will easier to use :) It should be cool to use a light blue on KEY OVER and a dark blue on KEY PRESS, and possibly leave the dark blue on a key that remains active as the key SHIFT or SHIFT for example. It's just a idea already use on the AMIGA emulator port on xbox.

waal commented 6 years ago

@CypherXG

Lovely, I believe that should be the one ! Good work, man.

Gilou9999 commented 6 years ago

That's what i call a nice virtual keyboard! It will brings a lot to the experience, playing our old games with a nice one like this!

midwan commented 5 years ago

As a first step, I've added the vbkd files from @rsn8887's UAE4All port in the repo (as well as other PSP2 related stuff, with the aim of making Amiberry work on PSVita/PSTV later).

rsn8887 commented 5 years ago

Note the files have since been updated (now with French keyboard, too): https://github.com/rsn8887/uae4all2/tree/master/src/vkbd

Keyboard images are here: https://github.com/rsn8887/uae4all2/tree/master/psp2data/data

midwan commented 5 years ago

@rsn8887 Thanks for the heads up! In a funny coincidence, I was experimenting with compiling Amiberry for the PSP2/PSVita/PSTV earlier today. :)

I had to remove the vbkd for now, since it's still using SDL1 calls and we've moved to SDL2 (I noticed that sdl2 to sdl1 header). I'll merge the latest you have and convert them to pure SDL2 at some later point, as I need to get other things fixed with it first (I got several files compiled normally, until I got to the fpp_native file - which requires fenv.h to get some definitions from there, but those could not be found in the vitasdk environment). Anyway, that's a different issue than this one...

sh0wst0pper commented 4 years ago

Sorry to revive an old thread but is there any progress on a virtual keyboard for Amiberry on retropie? I have this emulator on my switch (which has a virtual keyboard) and have just built a bartop arcade and this was the 1st emulator i had to have running. Most games dont require it but it would be nice to have.

If not then no problem and many thanks for this amazing app!

davidgrohl commented 2 years ago

any news about virtual keyboard?

midwan commented 2 years ago

@davidgrohl Yes, coming soon... :)

davidgrohl commented 2 years ago

Just updated to version 5.1. can you confirm no virtual keyboard added yet?

midwan commented 2 years ago

Just updated to version 5.1. can you confirm no virtual keyboard added yet?

It's not part of 5.1, as it wasn't quite ready to be included there. It still needs some work, so it will come with a future update.

Tobias2K18 commented 1 year ago

... any news?

erikbernsen commented 1 year ago

I was planning on adding this myself until I see it’s already being worked on. Is there somewhere I can try this out or contribute?

midwan commented 1 year ago

The dev branch has some work-in-progress implementation, but I haven't had time to revisit this lately. The current status is that the virtual keyboard is brought up on the screeen (with transparency) on-demand, and hidden again, but you can't select any keys to press yet. There are multiple themes for keyboards available as well, found in data/vkbd - the plan was to choose the one you prefer, or even use your own.

erikbernsen commented 1 year ago

Thanks. I finally got time to start looking into this. I downloaded the dev branch and compiled it. But didn't see that there is any functionality to bring up the virtual keyboard. The function vkdb_init and vkbd_redraw seem implemented but as far as I can see nowhere used yet. Or I'm overlooking it. As a very small hack I call vkbd_init and vkbd_redraw somewhere myself and indeed see the keyboard. It's a start to understand the code.

Screenshot

I have some questions; if this is addressed somewhere in documentation, could you please direct me to it.

CMake Error at CMakeLists.txt:21 (add_executable): Cannot find source file:

src/machdep/m68k.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

CMake Error at CMakeLists.txt:21 (add_executable): No SOURCES given to target: amiberry

Indeed src/machdep/m68k.cpp doesn't exist on disk. I'm just calling cmake as

cmake .

from the Amiberry directory. Am I doing something wrong here? I'm not very familiar with cmake.

midwan commented 1 year ago

@erikbernsen Hm, I had added a custom event which allowed you to trigger the on-screen keyboard with a press of a button (e.g. from a controller), but I can't find that code in the branch. Perhaps I had it in a separate branch which got deleted over time, I'm not sure at this point... :(

CMake works on the x86 branch, and I made some merges from there back to master and dev, but it appears I missed that file. Depending on the platform you're working on, you can use different options:

I am usually on Windows, so I mostly use either Visual Studio or VSCode, depending on what I'm doing. Let's take the rest on a new Discussion topic however, to avoid having such details on this issue: https://github.com/BlitterStudio/amiberry/discussions

erikbernsen commented 1 year ago

Thanks for confirming that. Could you let me know if you still have these changes locally as it would help. I was thinking a custom event was the way to enable this indeed.

midwan commented 1 year ago

Thanks for confirming that. Could you let me know if you still have these changes locally as it would help. I was thinking a custom event was the way to enable this indeed.

Unfortunately it seems that I lost those, when I deleted that branch (I was sure the changes were merged!). But they are not difficult to re-implement, and in fact I should sync that vkbd stuff across branches as well.

joolswills commented 1 year ago

They should still be in the git reflog. Worth checking anyway.

erikbernsen commented 1 year ago

My personal motivation to have a virtual keyword is this: I want a setup with raspberry pi where I can play all games with only two of my competition pro anniversary joysticks. Some games require the keyboard to start, quite a lot require the keyboard to enter your name in highscores. Having that in mind, I was thinking to make the virtual keyboard work as follow:

That's it. Is this indeed what people think of with virtual keyboard functionality?

Eventhough I'm new to Amiberry code I have the feeling this should be doable.

midwan commented 1 year ago

@erikbernsen That's exactly how I'd expect it to function also. And in the implementation I had done, which was never finished, that's how it worked.

I'll add the custom event again, since I can't seem to find the lost branch (even with git reflog, though I may not be using it right) and do some tests to make sure it's back to the same stage it was when I last touched it. What was missing back then was the navigation logic when the keyboard shows up, highlighting the selected key on the screen, pressing it etc. You could open/close the virtual keyboard with the custom event normally, and I had even added some transparency on it, so you can see what's underneath it.

Like I said, that's not too hard to re-implement at this stage, so I'll get that done and we'll take it from there. :)

erikbernsen commented 1 year ago

Thanks for that. I continued working on this today and made quite some progress. I got it to the point that you can toggle the virtual keyboard on or off; use the joystick to select a key; press fire to type the key. A lot of stuff is still missing like shift, sticky keys, nice indication what's the currently selected key; position of the keyboard; selecting different language keyboard; select translucency of keyboard.

midwan commented 1 year ago

@erikbernsen Sounds good, I'm happy you're making progress with it! :)

erikbernsen commented 1 year ago

@midwan I'm almost done with making it work for my setup and to my liking. I can only test for my setup and didn't try yet to make it work for other controllers and hardware. Will try to figure out how to create PR so you can review the code and maybe more people can test. Should I create a PR into dev branch or what's the best approach?

midwan commented 1 year ago

@erikbernsen That's great news! Please submit a PR towards master if you have something that works, and we'll test it from there.