ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Wii Port > Keyboard support? Goto page Previous  1, 2, 3, 4, 5, 6  Next
Keyboard support?
  Author    Thread Reply to topic
brijohn



Joined: 25 Jan 2009
Posts: 16
 

Ok I've fixed the bugs that Badablek mentioned in the last release. The issue with the AltGr key was actually a bug in my keymap compiler that didn't really show up til the changes in how modifier keys are delt with.

Keymap Compiler
- Fixes keymap generation bug

ScummVM r36278
- Fixes issue with e, j and x keys
- Includes fixed version of keymaps

 Reply with quote  
Post Thu Feb 12, 2009 4:14 pm 
 View user's profile Send private message
Red_Breast



Joined: 30 Sep 2008
Posts: 785
Location: The Bar Of Gold, Upper Swandam Lane.
 

Thanks briijohn. This is greatly appreciated. I felt a bit awkward asking and after I felt I should of tried to understand it a bit more myself instead.
I've been busy for a few days but now I have a long weekend off. I've been going through the 2 Indy games recently, to completion, and the key/b number pad has been handy for all the fights and boxing I keep starting. I wonder how Lucas will handle the boxing when the Wii version of Staff of Kings is released with it's Atlantis bonus.
Once again a big thanks.

 Reply with quote  
Post Thu Feb 12, 2009 5:56 pm 
 View user's profile Send private message
Badablek



Joined: 28 Jan 2007
Posts: 60
 

Thanks for the quick bugfix (again) Very Happy

Now eveyrything works as expected, nice job.


I have updated my french keymap, made some mistakes on the previous one : <> , <> " and added Euro symbol (even if scummvm does not support it and does not display it)

http://www.gx-mod.com/team/perso/Badablek/French_keymap_updated.zip


little question : adding capslock support (press once > enable, press again, disable) is in your TODO list ? and Numlock ? I should update my keymap in consequence.

 Reply with quote  
Post Thu Feb 12, 2009 6:23 pm 
 View user's profile Send private message
Bossk



Joined: 03 Nov 2008
Posts: 107
 

Great job brijohn!

However, the 0-9 number keys of the virtual keyboard still don't work for me.
I am not using a keymap at all (not copied, not enabled). Could that be it?

I can't test further anymore unfortunately. Will try tomorrow.

[edit]Seems to be a virtualkeyboard bug, not your patch bug Wink
I am going to file a bug and see what happens.

[edit2]Simple fix. I updated the xml in the vkeybd.zip.
Uploaded the new version and submitted it, hope it will be in trunk soon.
See link in sig for it.

 Reply with quote  
Post Thu Feb 12, 2009 8:59 pm 
 View user's profile Send private message
brijohn



Joined: 25 Jan 2009
Posts: 16
 

quote:
Originally posted by Badablek

little question : adding capslock support (press once > enable, press again, disable) is in your TODO list ? and Numlock ? I should update my keymap in consequence.


Yeah i'm planning to add support for the caps and num lock keys. Probably this weekend. For capslock though i'll probably write it as shift lock instead of a true caps lock meaning it will use the shift state for all keys not just your alpha keys. Num lock will only use the shift state if the second key in the group is a KP_* key
 Reply with quote  
Post Fri Feb 13, 2009 9:17 pm 
 View user's profile Send private message
dhewg
ScummVM Porter


Joined: 04 Jun 2008
Posts: 169
 

i finally found the time to look at libwiikeyboard and your changes, brijohn.

With some changes to the code i commited libwiikeyboard plus your patches to my libogc git branch, which you can find here since today.

What i did change:
- got rid of keyboard_priv.h and keymapper.c, the code is in keyboard.c now. the "_manager" var shouldn't be public and its struct has been defined twice (and differently!)
- i removed the ability to load keymaps from a filesystem, since these maps are tiny in compiled size. there's currently only the english and german map in there (got bored Razz). the map gets chosen by the language the wii is set to, but an application can just load another one.

i also commited your ScummVM patch to trunk, again with some changes. Its mostly cleanup work, but i'd like to hear your opinion on what i changed, especially why you used this code:

code:

      } else if (kbdEvent.type == KEYBOARD_RELEASED) {
         event.type = Common::EVENT_KEYUP;
         if (prevScan == kbdEvent.keysym.scancode)
            kbdEvent.keysym.sym = KEYBOARD_GetKeySym(prevScan, prevMod);
      } else {




thanks alot for your work and patches!
 Reply with quote  
Post Sat Feb 14, 2009 7:30 pm 
 View user's profile Send private message
dhewg
ScummVM Porter


Joined: 04 Jun 2008
Posts: 169
 

I took a closer look at the code yesterday and noticed alot of problems:

- memory leaks
- missing error checking
- inconsistency
- not so useful features like multiple keyboards support and multiple event callbacks
- scan for new keyboards with every event poll

I messed around and changed alot of code, but i believe its better now. I would appreciate it if you take a look and give me some feedback, brijohn.

 Reply with quote  
Post Sun Feb 15, 2009 12:41 pm 
 View user's profile Send private message
brijohn



Joined: 25 Jan 2009
Posts: 16
 

dhewg,

Thanks for getting this including in the in the main scummvm repositories.

A few of my comments about your integration of libwiikeyboard.

First you really should not remove loading of the keymaps from the SD card. I know the keymaps themselves do not take up much space if compiled in but size is not really the reason for that design decision. I chose to do loading of keymaps as well as choosing whcih keymap to use from the SD card because it offers the most flexibility. If the keymaps are compiled int either adding or updating a keymap becomes a huge pain since it requires recompiling not just libwiikeyboard but any program that is compiled against it. This in my opinion is quite undesirable. Furthormore while trying to select a keymap based on the language settings of the wii may seem like a good idea it too offers problems. for instance i have and use a japanese based keyboard however my WII is a US one how then am i supposed to seelct the right keymap for my keyboard? Not to mention things like that fact i can think of at least 4 different US layouts alone how can i choose a different one if its simply based on the language setting of the wii? When I originally wrote the keymapper i berifly considered using built in keymaps and possibly choosing one based on the language setting as well but quickly discarded those ideas for the above reasons.

Also in regards to the code snippet you posted that is to fix and issue regarding a difference in how libwiikeyboard is designed to behave vs what is expected by scummvm. When libwiikeyboard gets a press or release event it sends the scancode, keysym and modifiers that were pressed both the modifiers and symbol CAN be different from the press to release event of a certain key, whereas the scancode whcih represents a physical key on the keyboard will always be the same. Scummvm however will use the keysym to try and determine when to stop repeating a key that is continually held down. If that differs on keyrelease it will continue repeating the last key pressed. You can try this by holding down shift pressing a key till it starts repeating, then release shift followed by releasing the other key and it should continue to repeat till you press some other key. The code I added was designed to make scummvm agree on the keysym. This also means that the function for translating keysyms form scancodes should be publicly available to applications to use if they want. Also in scummvm you probably don't really need to catch the connected/disconnected events since you don't really need to do anything with them anyways.


Your other changes i haven't gone over as much but that look fine. I've been flip-flopping back and forth on getting rid of multiple keyboards, but i suppose it does simplify some things and i've had some trouble thinking when you would actually need to be able to use more then one at a single time anyways so i suppose I'm fine with that.

Also my current version of the library is available using git from here. It includes an update that handles ShiftLock and NumLock when translating keysyms.

 Reply with quote  
Post Mon Feb 16, 2009 4:19 am 
 View user's profile Send private message
brijohn



Joined: 25 Jan 2009
Posts: 16
 

Ok updated version of the keyboard build. This one includes support for CapsLock and Numlock in libwiikeyboard also added key repeat to libwiikeyboard as well as many of the patches dhweg made to clean up some of the code and fix memory leaks.

ScummVM rev38377
- supports CapsLock(ShiftLock) and NumLock
- disable scummvm keyrepeat in favor of using libwiikeyboard
- fixes issue with 0-9 on virtual keypad
- fix return key on virtual keypad to work

 Reply with quote  
Post Mon Feb 16, 2009 7:34 pm 
 View user's profile Send private message
Maxrunner



Joined: 30 Mar 2008
Posts: 29
 

Just tryed the last version, but it takes more than usual to enter, and using the keyboard i get the symbols inside the [], did i install it wrong??? i plugged a keyboard in the console and it seems to be working at least pressing space pauses the game. When i quit it goes all black and doesnt return to hb menu.

 Reply with quote  
Post Mon Feb 16, 2009 8:49 pm 
 View user's profile Send private message MSN Messenger
brijohn



Joined: 25 Jan 2009
Posts: 16
 

quote:
Originally posted by Maxrunner
it takes more than usual to enter

Not sure what you mean by this.

quote:
Originally posted by Maxrunner
using the keyboard i get the symbols inside the []

do you mean when using the virtual keyboard? if so that is normal.

quote:
Originally posted by Maxrunner
i plugged a keyboard in the console and it seems to be working at least pressing space pauses the game. When i quit it goes all black and doesnt return to hb menu.

I have no issues exiting back to the homebrew channel myself. so I'm not sure what the issue is here. does it do this for all games or just certain ones?
 Reply with quote  
Post Mon Feb 16, 2009 9:10 pm 
 View user's profile Send private message
Maxrunner



Joined: 30 Mar 2008
Posts: 29
 

quote:
Originally posted by brijohn
quote:
Originally posted by Maxrunner
it takes more than usual to enter

Not sure what you mean by this.

quote:
Originally posted by Maxrunner
using the keyboard i get the symbols inside the []

do you mean when using the virtual keyboard? if so that is normal.

quote:
Originally posted by Maxrunner
i plugged a keyboard in the console and it seems to be working at least pressing space pauses the game. When i quit it goes all black and doesnt return to hb menu.

I have no issues exiting back to the homebrew channel myself. so I'm not sure what the issue is here. does it do this for all games or just certain ones?


Thanks for answering, well i thought you could use the keyboard when you call the virtual keyboard. So whats the way to use the virtual keyboard?Also do i have to unzip the files vkeybd.zip and scummmodern/classic.zip???

i might be putting the files in the wrong places?
 Reply with quote  
Post Mon Feb 16, 2009 10:26 pm 
 View user's profile Send private message MSN Messenger
brijohn



Joined: 25 Jan 2009
Posts: 16
 

If you are using a real USB keyboard you do not need to use the virtual one. The virtual keyboard is only necessary if you do not have a physical keyboard.

If you are going to use the virtual keyboard just use the pointer to select the characters you want and then close the virtual keyboard. Also don' unzip vkeybd.zip either.

 Reply with quote  
Post Mon Feb 16, 2009 11:11 pm 
 View user's profile Send private message
Maxrunner



Joined: 30 Mar 2008
Posts: 29
 

quote:
Originally posted by brijohn
If you are using a real USB keyboard you do not need to use the virtual one. The virtual keyboard is only necessary if you do not have a physical keyboard.

If you are going to use the virtual keyboard just use the pointer to select the characters you want and then close the virtual keyboard. Also don' unzip vkeybd.zip either.


Ok, how do i active what i type in the virtual keyboard??
Still, very nice work, i have to try some sierra games to test the keyboard.

thanks
 Reply with quote  
Post Mon Feb 16, 2009 11:29 pm 
 View user's profile Send private message MSN Messenger
Red_Breast



Joined: 30 Sep 2008
Posts: 785
Location: The Bar Of Gold, Upper Swandam Lane.
 

If you're asking how do I pull up the virtual key/b it's down on the wiimote d-pad.

Briijohn I have noticed that when quitting sometimes ScummVM 'hangs'. Using Esc on the USB key/b always gets me back to the Homebrew Channel though.
Thing is I can't remember what menu I've been using to quit when I've had this hanging. I seem to remember you can quit from the in-game GMM menu as well as the main launcher menu.
Or maybe like you say it's game related.

 Reply with quote  
Post Tue Feb 17, 2009 12:10 am 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 
Goto page Previous  1, 2, 3, 4, 5, 6  Next


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge