English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 18 May 2019, 15:08   #1
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Bug? - keyboard detection?

Apologies - sure I am being an idiot..


But using latest WinUAE, ver 4.2.0 and 4.2.1 on Win 10 Pro 1809 (fully patched etc)


Just set up a AmigaOS 3.1.4 and was having trouble with key mapping. But when I came out and checked in WinUAE - issue seems be there.. i.e.


Start WinUAE go to the "input" tab.. ensure nothing selected.. i.e. I just want it use Windows "compatability mode" (per the help docs.. though help does not say how to set that mode.. I assume you just ensure nothing selected). Anyway - I am in UK and so have UK keyboard.. but when I use "test" option on that tab.. and then press the "#" key, it reports that I have hit the "backslash" key. (which matches the problem I see in AmigaOS)


So what I doing wrong please? I could prob try remap everything to match - but surely that should not be necessary?


Thanks in advance for help .. and feel free to mock me for my stupidity

Last edited by Yoji; 18 May 2019 at 19:56.
Yoji is offline  
Old 19 May 2019, 08:49   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,140
Key mapping is based on scan codes (physical key location), not keyboard layouts or key labels. Names in GUI are mostly using original US names. Unfortunately there is no sane way to match them to actual key labels because some layouts use shift to access some keys, some alt gr, some does not need qualifier keys etc.

Make sure correct Amiga side keyboard layout is set if keys in Workbench don't match key labels.
Toni Wilen is online now  
Old 19 May 2019, 12:47   #3
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Thanks Toni,

I had of course set the correct "British" keyboard type in AmigaOS prefs.. but even when I done that, its "keyboard test" feature showing the exact same incorrect mapping of keys as I see in WinUAE, as I said.

I know key mappings are a PITA, but that was why I was expecting the phase in your help docs "You can specify Compatibility mode with standard Windows setup" to mean you leave it all to windows to sort out - and send the keys Windows tells you have been pressed.

I notice I don't have the problem when I use Amiga Forever..that seems to work correctly, and I get the correct keys showing in AmigaOS keyboard test feature (again - when I have "British keyboard" selected in prefs). So how are they doing it when there is "no sane way"?

P.S. In view of your comment - to confirm, I am using a Razer Black Widow Ultimate Keyboard.. which seems to be correctly identified in the WinUAE "input" tab.. but still has the mapping issue. Are you saying another physical keyboard may work better (depending on its physical key layout?) that's got to be crazy?
Yoji is offline  
Old 19 May 2019, 14:10   #4
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 47
Posts: 1,799
The "Razer Black Widow Ultimate Keyboard" looks like one of those exotic and expensive gaming keyboards. Maybe try a stock, standard Windows keyboard instead to see if the problem goes away?
Foebane is online now  
Old 19 May 2019, 14:18   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,140
AF is not a good test case, it tries to solve the problem outside of Amiga automatically and may not return same results as real hardware with same Amiga keymap. (and this cause annoying side-effects with programs that don't use WB keymap. I don't like this kinds of hacks.)

EDIT: Which Amiga key are you pressing and what key appears in WB and what was expected key? I can test this using real hardware but I expect it to be correct, it isn't always what you expect..

Last edited by Toni Wilen; 19 May 2019 at 14:52.
Toni Wilen is online now  
Old 19 May 2019, 17:00   #6
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by Foebane View Post
The "Razer Black Widow Ultimate Keyboard" looks like one of those exotic and expensive gaming keyboards. Maybe try a stock, standard Windows keyboard instead to see if the problem goes away?

OK - I did that .. I used what I believe to be a pretty standard Keyboard.. a Cherry G-224 (again - UK key layout) and the experience was identical.


Cheers
Yoji is offline  
Old 19 May 2019, 17:19   #7
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by Toni Wilen View Post
EDIT: Which Amiga key are you pressing and what key appears in WB and what was expected key? I can test this using real hardware but I expect it to be correct, it isn't always what you expect..

Hope we not talking at crossed purposes.. I not sure about your "I can test using real hardware".. and I thought I had given example.. but let me try and summarise.


I am using WinUAE 4.2.1 on a Win 10 Pro 1809 fully patched.. and a Razer Blackwidow uk keymap keyboard. On WinUAE I have set up a clean AmigaOS 3.1.4 install (based on A4000D). The install seems fine, and my locale has been set to Great Britain, and the input keyboard set up as British.


When in AmigaOS with all above config, when I am in the "Input" prefs and use the "keyboard test" feature.. if I press the "#" (Hash) key on my keyboard, the Amiga shows that I have pressed "" (backslash). If I press the "Prt sc" (print screen) key in Amiga test - it shows no registration of any key press.


So - exiting Amiga.. and going into WinUAE… if I go to the "input" tab and using the "test" button.. when I then press "#" on my keyboard - it registers as "backslash". more specifically Input Source as "BACKSLASH[0x2B]" and if I use "Prt sc" on my keyboard it registers as "SYSRQ[0xB7]" (which seems correct).


The reason I tested the Prt sc/Sys rq key is that in Amiga I tested using WHDLoad and the game said to use the Prt sc key to exit - but using the key had no effect - it did not stop and exit the game.



Anyway - hope I have provided all the info you need. Please let me know if you need more info .. or have questions.


Cheers
Yoji is offline  
Old 19 May 2019, 19:08   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,140
I think I finally understood

WHDLoad message can be a bit misleading because Amiga does not have separate print screen key but most Amiga keyboards (except A1000) have extra PC key labels in front of numpad keys.

Amiga numpad * = Prt Sc.

Scan code 2B key is very region specific (and also few nearby keys too). It probably would be less confusing if keyboard editing is based on image of keyboard without key labels This isn't just UK layout problem, on my keyboard for example that same key isn't either # nor backslash.

This is unsolvable problem, for example keyboard hardware layout may not be same as host OS layout which may not be same as Amiga layout. It still needs to work = key position (scan code) is the only thing that stays the same.
Toni Wilen is online now  
Old 19 May 2019, 21:13   #9
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by Toni Wilen View Post

This is unsolvable problem, for example keyboard hardware layout may not be same as host OS layout which may not be same as Amiga layout. It still needs to work = key position (scan code) is the only thing that stays the same.

Excuse me.. "unsolvable problem"? are you mad?
Am I understanding this correctly? are you saying (and I paraphrase) "Sorry - when using WinUAE there is no way you can know what key to press to get the desired key in a Amiga guest environment"?
Because you have no idea what scan code relates to what key?
And you criticise AF? who perhaps have not the most elegant solution, but it works for me.. and somehow manages to solve the unsolvable problem (for me at least.. and I suspect most people).


Anyway - I am probably going off "half cocked" - so please can you elaborate on why this should not be MUCH better in WINUAE. You seem be saying that anyone with a UK keyboard (or prob ANY keyboard) will have problems to some extent? I mean … a # key is not really very special.. yet is a problem.


Was this problem not solved 30 years ago with code page translations?


Anyway - I will try stay calm and let you elaborate
Thanks.
Yoji is offline  
Old 19 May 2019, 21:25   #10
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 42
Posts: 15,202
You really need to chill out there Yoji!!!

Insulting the man who is giving you honest answers and who has been responsible for the best Amiga emulator bar none over the past 20 years; is not going to do you any favours...

Have a look at an Amiga keyboard vs a current PC standard keyboard; you will see that there are more keys on the PC keyboard... this makes 100% mapping quite difficult; and I'm only talking about a UK layout.

You do realise that the bloatware product named "Amiga Forever" actually uses WinUAE as base; without this it would be absolutely useless

Last edited by DamienD; 19 May 2019 at 21:35.
DamienD is offline  
Old 19 May 2019, 22:10   #11
malko
Ex nihilo nihil

malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 2,109
@Yoji : Damien & Toni are right. Maybe check this. It may help you doing your mapping correctly.
malko is offline  
Old 19 May 2019, 22:39   #12
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by DamienD View Post
You really need to chill out there Yoji!!!

Insulting the man who is giving you honest answers and who has been responsible for the best Amiga emulator bar none over the past 20 years; is not going to do you any favours...

Have a look at an Amiga keyboard vs a current PC standard keyboard; you will see that there are more keys on the PC keyboard... this makes 100% mapping quite difficult; and I'm only talking about a UK layout.

You do realise that the bloatware product named "Amiga Forever" actually uses WinUAE as base; without this it would be absolutely useless

I don't want a fight - so I will just leave it to say, just because it does a lot of things really well - it does not mean it is beyond criticism for things it does not do well.


Your point re "Look at Amiga keyboard" does not make sense.. yes, of course PC keyboard has more keys.. that's good.. it means you have a superset.. you don't have to map every PC key.. you just need map enough keys to cover every Amiga key (accurately, or use one of the extras to cover something like the "Amiga" key - where there is no direct PC comparison, and the ones you have left over can be the special ones they use for things like "Ctrl 11" to exit WinUAE even if Amiga is running) - you don't have to send that to Amiga.



And Yes .. of course I know AF sits on top of WinUAE (It just today updated to use WinUAE 4.2.1).


So apologies if I am coming over a bit strong - but it does get my blood up a tad when anyone just tries to use an argument from authority, and expect that to close the discussion - when we see others solving it. And if you don't like how AF have done it - do it better.. don't just say its unsolvable. So a more honest answer might have been "Sorry - it was too much effort - we didn't think it worth it".. or something.


But I am hopeful for a explanation that helps me understand, since their help files do talk about windows compatability mode.. so whats that? it SOUNDS like it should be letting the OS do the initial key interpretation.


Cheers
Yoji is offline  
Old 19 May 2019, 22:57   #13
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 42
Posts: 15,202
Quote:
Originally Posted by Yoji View Post
when we see others solving it. And if you don't like how AF have done it - do it better..
Straight back at you; let's see you solve this then

Toni already mentioned that he doesn't do hacks... and it's not as simple as you may think.

If Amiga Forever is the solution for you then use it!!!
DamienD is offline  
Old 19 May 2019, 22:58   #14
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by malko View Post
@Yoji : Damien & Toni are right. Maybe check this. It may help you doing your mapping correctly.


Thanks,


That's interesting.. it does suggest that the # key on my board maps to the 0x2B rawkey, as reported in WinUAE,
But since that link does not show a UK keyboard map (normal keyboard.. the keyboards shown are all Amiga keyboards… not PC) - I cant say why it shows a backslash..
A Backslash is in position 0x3A on my keyboard (standard UK keyboard.. its same place on all 4 keyboards I have in house)


So is it strange that WinUAE does not know that? what keyboard is it assuming to show 0x2B as a backslash?


As I said - I know key mapping is a right royal PITA..
Cheers
Yoji is offline  
Old 20 May 2019, 09:03   #15
malko
Ex nihilo nihil

malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 2,109
The following links are not WinUAE specific, but did you check them to have a general understanding of what is happening when you "simply" press a key ?
- #1 ;
- #2 .
malko is offline  
Old 20 May 2019, 09:52   #16
malko
Ex nihilo nihil

malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 2,109
Don't know it it's the 2016 variant that you have, so hope the picture is conform to your keyboard.
Seems that your keyboard is missing 3 keys compared to an Amiga one (red, green & blue arrows) and has 1 key that is not present on Amiga (yellow arrow).
Attached Thumbnails
Click image for larger version

Name:	BWU-vs-A.gif
Views:	56
Size:	218.3 KB
ID:	63168  
malko is offline  
Old 20 May 2019, 16:25   #17
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,140
You still fail to understand it. This is not a virtual machine that only runs some "known" OS versions with known software and drivers. Which would make very easy. This is hardware emulator and it must work even if running OS is unknown and even worse, "OS" can change multiple times without reboot! (=program that takes over the system)

As I said, I don't do ugly hacks that only work in some specific situations and cause unexpected issues in other situations. This is Amiga where main rule is that too many programs do weird things. ("They are bad programs, they can be ignored" is wrong answer. There are far too many of them)

One way to make this work (in WB only): ask AmigaOS current used layout and mapping (which is what AF does and afaik it has hardcoded tables for PC side keymaps). Another way would be to "inject" some kind of fake layout that matches current layout but that gets really tricky (This would be my choice). They still break immediately if you run pre-2.0 AOS or 4.x+. Or Linux.

What about WHDLoad games. They ignore AmigaOS keyboard layout (because it takes over the system). Or any other game, most of them read raw key codes even if they are system friendly. How would the emulator know when to use which layout? (Hint: It can't, it can only guess). For example some german games simply assume german keyboard layout.

Amiga hardware requires key scan codes, emulator has to send key scan codes. What if single key press needs more than single key code to create matching Amiga side key? (There surely are differences between Amiga and modern Windows keymaps, Amiga maps are from 1980s after all) It can get really confusing if program does not use AmigaOS key routines or reads raw key codes.

Lots of nasty side-effects are possible, some can be solved, some can't be. Ever.
Toni Wilen is online now  
Old 20 May 2019, 17:58   #18
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by malko View Post
Don't know it it's the 2016 variant that you have, so hope the picture is conform to your keyboard.
Seems that your keyboard is missing 3 keys compared to an Amiga one (red, green & blue arrows) and has 1 key that is not present on Amiga (yellow arrow).

Thanks - not quite - mine is 2014 model .. and is a better match.
and is more "standard" UK PC keyboard (except the Macro keys on left)
You can see UK Amiga keyboard as well for ref.
Attached Thumbnails
Click image for larger version

Name:	keyboards.GIF
Views:	28
Size:	391.6 KB
ID:	63175  
Yoji is offline  
Old 20 May 2019, 18:20   #19
Yoji
Registered User

 
Join Date: May 2015
Location: newcastle-under-lyme
Posts: 52
Quote:
Originally Posted by Toni Wilen View Post
You still fail to understand it. This is not a virtual machine that only runs some "known" OS versions with known software and drivers. Which would make very easy. This is hardware emulator and it must work even if running OS is unknown and even worse, "OS" can change multiple times without reboot! (=program that takes over the system)

As I said, I don't do ugly hacks that only work in some specific situations and cause unexpected issues in other situations. This is Amiga where main rule is that too many programs do weird things. ("They are bad programs, they can be ignored" is wrong answer. There are far too many of them)

One way to make this work (in WB only): ask AmigaOS current used layout and mapping (which is what AF does and afaik it has hardcoded tables for PC side keymaps). Another way would be to "inject" some kind of fake layout that matches current layout but that gets really tricky (This would be my choice). They still break immediately if you run pre-2.0 AOS or 4.x+. Or Linux.

What about WHDLoad games. They ignore AmigaOS keyboard layout (because it takes over the system). Or any other game, most of them read raw key codes even if they are system friendly. How would the emulator know when to use which layout? (Hint: It can't, it can only guess). For example some german games simply assume german keyboard layout.

Amiga hardware requires key scan codes, emulator has to send key scan codes. What if single key press needs more than single key code to create matching Amiga side key? (There surely are differences between Amiga and modern Windows keymaps, Amiga maps are from 1980s after all) It can get really confusing if program does not use AmigaOS key routines or reads raw key codes.

Lots of nasty side-effects are possible, some can be solved, some can't be. Ever.

Thanks Toni,


As I have said - I do appreciate that its not at all easy.. but you seem to have gone down the route of because WinUAE cant do a 100% solution - WinUAE is doing nothing.


I am happy to concede that no solution will be perfect but right now.. I don't seem to have a solution to get a damn "#" key to show in AmigaOS, or a logical way to work out whats needed and manually remap.


From your description - I can imagine every WinUAE user will have such problems? (i.e. the chance of any GE/FR/US etc PC keyboard mapping key scan codes nicely to Amiga is almost nil?).


WinUAE site seems be down currently - so I will check later..in case I missed something, but what is the best/correct way for me to solve my problem? I just want to try and map "main" keys from my PC to show up sensibly in AmigaOS WB


Cheers.
Yoji is offline  
Old 20 May 2019, 19:19   #20
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,140
Amiga GB keymap "#" = alt+shift+3 (don't ask why, it simply is. Real hardware confirmed)
Toni Wilen is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full-Screen detection bug(s) Hungry Horace support.FS-UAE 24 16 August 2014 15:55
Keyboard control Winuae Properties Bug smoorke support.WinUAE 3 21 January 2009 12:11
M.I.D.I. in detection bug GROSDAMS support.WinUAE 2 13 September 2008 01:05
Keyboard LED bug BenniP support.WinUAE 5 22 May 2004 13:25
Bug in WinUAE keyboard routine Roderick support.WinUAE 1 03 September 2002 23:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.09317 seconds with 14 queries