English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 07 December 2012, 20:45   #1
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
FS-UAE: function keys and key reassignment

How can I use function keys in the emulation? My function keys are assigned for Mac functions and when I press the keys in the emulation, the Mac function is done instead. Is there a way to override that when in the emulation (similar to mouse) or is there a way to re-assign keys?

Also, the FS-UAE menu comes up on pressing F12. My keyboard doesn't have an F12 (IBM Model F). Is there a way to remap that key? If not, where in the source should I look to manually change it?

Edit: corrected menu/launcher confusion

Last edited by mr_a500; 14 December 2012 at 01:21.
mr_a500 is offline  
Old 08 December 2012, 00:05   #2
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Hi, well first of all, if this is a laptop keyboard (or perhaps it applies to all keyboards on OS X?), you need to either
- toggle the Fn-lock key (if there is one), or
- Use use Fn key in combination with the F-key, or
- Change a system setting so the F-keys are really F-keys and not brightness/volume keys etc.
(I assume this was not what you were thinking of, but for completeness...)

Secondly, some function keys are used for special purposes in OS X (dashboard / expose / whatever). These keys are intercepted before FS-UAE gets them, so this is out of FS-UAE's control. But you can:
- Disable these functions in system settings, or
- Run FS-UAE fullscreen, as these OS X key shortcut grab only applies when in desktop mode.

About re-assigning keys: you can configure other keyboard keys to press the Amiga function keys if necessary. See http://fengestad.no/fs-uae/input-mapping and http://fengestad.no/fs-uae/input-actionsFor example:
Code:
keyboard_key_q = action_key_f1
Additional notes:
- The F12 key does not bring up FS-UAE Launcher, but the internal FS-UAE Menu.
- Edit: removed incorrect statement.
- FS-UAE Launcher is not compiled. It is a pure python program and can even be run without installation. But you need required Python libraries installed of course.
- I didn't understand the mouse reference

Last edited by FrodeSolheim; 08 December 2012 at 01:08.
FrodeSolheim is offline  
Old 08 December 2012, 00:26   #3
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
Quote:
Originally Posted by FrodeSolheim View Post
Hi, well first of all, if this is a laptop keyboard (or perhaps it applies to all keyboards on OS X?), you need to either
- toggle the Fn-lock key (if there is one), or
- Use use Fn key in combination with the F-key, or
- Change a system setting so the F-keys are really F-keys and not brightness/volume keys etc.
(I assume this was not what you were thinking of, but for completeness...)
As I said, it's an IBM Model F. There is no Fn key.



Quote:
Originally Posted by FrodeSolheim View Post
About re-assigning keys: you can configure other keyboard keys to press the Amiga function keys if necessary. See http://fengestad.no/fs-uae/input-mapping and http://fengestad.no/fs-uae/input-actionsFor example:
Code:
keyboard_key_q = action_key_f1
I'll check that out. What I'd like to do is something like Apple Command + Function key = Amiga function key. (or shift + function or ctrl + function)


Quote:
Originally Posted by FrodeSolheim View Post
Additional notes:
- The F12 key does not bring up FS-UAE Launcher, but the internal FS-UAE Menu.
- The F11 key will also open the same menu. So you can use either F11 or F12.
- FS-UAE Launcher is not compiled. It is a pure python program and can even be run without installation. But you need required Python libraries installed of course.
I pressed F11 (numeric 0 remapped as F11) and all it did was toggle between a bunch of different scalings/aspect ratios.

Last edited by mr_a500; 07 November 2018 at 16:52.
mr_a500 is offline  
Old 08 December 2012, 01:24   #4
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Regarding the function key mapping, you should be able to do for example:
Code:
keyboard_key_shift_f1 = action_key_f1
(It seems I have forgot to document this... Also, instead of just using shift here, you can also insert ctrl, ctrl_shift, ctrl_shift_alt, ctrl_alt, shift_alt and alt).

The downside of this is that the shift key press will be sent to the Amiga before the function key press -which may be undesirable. I think I will implement an action_none setting, so you can also specify something like this:
Code:
keyboard_key_rshift = action_none
In this case, you should be able to use right shift + function key without the right shift key press itself being sent to the Amiga (or you could do this with left shift, this was just an example). This works because keyboard_key_shift_* will trigger on both left and right shift combinations.

You're right about the F11 key, I must be too tired ;-) (F11 and F12 can be both used as modifier key for FS-UAE shortcuts though). Ideally, I'll fix it so it can be remapped with "action_menu", but it's currently hardcoded. The key can be reprogrammed in the "handle_shortcut" function in libfsemu/src/emu/input.c.
FrodeSolheim is offline  
Old 08 December 2012, 03:08   #5
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
Excellent. Thanks!
mr_a500 is offline  
Old 10 December 2012, 21:05   #6
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
Quote:
Originally Posted by FrodeSolheim View Post
Regarding the function key mapping, you should be able to do for example:
Code:
keyboard_key_shift_f1 = action_key_f1
(It seems I have forgot to document this... Also, instead of just using shift here, you can also insert ctrl, ctrl_shift, ctrl_shift_alt, ctrl_alt, shift_alt and alt).
Unfortunately, this doesn't work. No modifier keys work. I can do unmodified keys like: keyboard_key_q = action_key_f1 - but that doesn't really help me.

(unrelated little annoying bug - when running FS-UAE from dock icon, Mac pointer stays on centre of emulation window (doesn't disappear like it should). This doesn't happen when running FS-UAE from finder.)
mr_a500 is offline  
Old 11 December 2012, 16:59   #7
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by mr_a500 View Post
Unfortunately, this doesn't work. No modifier keys work. I can do unmodified keys like: keyboard_key_q = action_key_f1 - but that doesn't really help me.

(unrelated little annoying bug - when running FS-UAE from dock icon, Mac pointer stays on centre of emulation window (doesn't disappear like it should). This doesn't happen when running FS-UAE from finder.)
I just tested the following:
Code:
keyboard_key_shift_q = action_key_f10
with the game Desert Strike, and Shift Q did indeed open the (F10) menu.

Perhaps FS-UAE was not configured correctly? If you attach FS-UAE.log, I can see what settings you have used.

I have not heard about the pointer issue, but I will register the issue at http://code.google.com/p/fs-uae/issues/list so I remember to check it out.
FrodeSolheim is offline  
Old 11 December 2012, 18:02   #8
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
I looked at the log and I think I see the problem. It says it can't find the config file for keyboard. I thought all config options were supposed to be added to the Default.fs-uae file, but do keyboard options go into a keyboard config file? What filename is it looking for? (so I can create it)

Last edited by mr_a500; 07 November 2018 at 16:52.
mr_a500 is offline  
Old 11 December 2012, 18:10   #9
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
No, the messages you're referring to are regarding the config file for (keyboard) joystick emulation (which it does not seem to find?). The general key mapping system does not have anything to do with this.

From the log file, it appears that "keyboard_key_shift_q = action_key_f1" is correctly configured, so Shift+Q should result in a F1 Amiga key press. I can perform a test on a Mac later, in case it is a platform-specific problem
FrodeSolheim is offline  
Old 14 December 2012, 01:28   #10
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
I changed the code to open the menu on F11 instead of F12 and I'm happy with that. Now I just need the function key remapping to work. Modifier keys don't seem to work.
mr_a500 is offline  
Old 16 December 2012, 22:20   #11
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
I've also noticed that some keys seem to be hardcoded to strange mappings. Reassigning them in the config file has no effect.

On the numeric keypad:
7 = "("
9 = ")"
1 = Help
3 = Right Amiga

I'd like these keys to be the same as Amiga numeric keypad so that:
7 = Home
9 = PgUp
1 = End
3 = PgDn
mr_a500 is offline  
Old 17 December 2012, 17:33   #12
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Yes, the keys are hardcoded, but hopefully not to "strange mappings". FS-UAE uses the "scancode" (or the closest it gets from the OS) to map the keys against Amiga keys, and does not use translated key codes from the OS.

If you have a non-standard keyboard (I don't know how this old keyboard of yours is hooked yet), perhaps the key codes are wildly different -but that it still works well with normal use because you have a OS keyboard map which maps correctly to translated keys? Does this make any sense to you? What kind of "keyboard type" have you configured in the OS?

If this is the problem, possible solutions include:
- Supporting loadable key maps, so a custom mapping between key codes and Amiga keys can be specified.
- An option in FS-UAE to use translated key codes instead of untranslated ones (a less ideal solution, but should work fairly well).
FrodeSolheim is offline  
Old 17 December 2012, 17:51   #13
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
Quote:
Originally Posted by FrodeSolheim View Post
Yes, the keys are hardcoded, but hopefully not to "strange mappings". FS-UAE uses the "scancode" (or the closest it gets from the OS) to map the keys against Amiga keys, and does not use translated key codes from the OS.

If you have a non-standard keyboard (I don't know how this old keyboard of yours is hooked yet), perhaps the key codes are wildly different -but that it still works well with normal use because you have a OS keyboard map which maps correctly to translated keys? Does this make any sense to you?
I see what you're getting at - that my strange keyboard is sending strange scancodes that are producing strange results... but what does a "normal" PC keyboard do in FS-UAE when you press numeric keypad "7" with numlock off? (I have no "normal" keyboard to test with )

I don't know why any keys are hardcoded. Doesn't that defeat the purpose of custom input mapping? (...unless you're saying that the keys are hardcoded but can be overridden by custom input mapping - and mine didn't work because the key I am trying to override is not the key that FS-UAE sees... is that what you're saying?)

Last edited by mr_a500; 17 December 2012 at 18:10.
mr_a500 is offline  
Old 17 December 2012, 18:16   #14
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Yes, that is kind of what I suggested, but I didn't suggest that it didn't work in other programs which uses translated key codes (which is the normal).

FS-UAE uses "physical key mapping" so keymaps will work probably inside Amiga, and also, for custom input mapping, the key names in configurations will then be independent of the key map chosen in your OS preferences.

You can enable some extra debug output by setting the following environment variable:
Code:
export FS_DEBUG_INPUT=1
and then run FS-UAE. You can also run fs-uae with --stdout to also output log to stdout, so can run FS-UAE from the console and see the log output as you press keys.

I'll have to dig out the Mac and check what key codes i get when pressing those keys (I could check the source code of course, but better to check with an actual keyboard in case I've registered keys incorrectly).
FrodeSolheim is offline  
Old 17 December 2012, 18:31   #15
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
OK, I did the FS_DEBUG_INPUT:

Code:
SDL key sym 278 mod 0 scancode 115 state 1
--> key_code 278 key_mod 0 state 1: "HOME"
  = press (index 28950) => input event 200
SDL key sym 278 mod 0 scancode 115 state 0
--> key_code 278 key_mod 0 state 0: "HOME"
  = press (index 28950) => input event 200
SDL key sym 280 mod 0 scancode 116 state 1
--> key_code 280 key_mod 0 state 1: "PAGEUP"
  = press (index 28952) => input event 201
SDL key sym 280 mod 0 scancode 116 state 0
--> key_code 280 key_mod 0 state 0: "PAGEUP"
  = press (index 28952) => input event 201
SDL key sym 281 mod 0 scancode 121 state 1
--> key_code 281 key_mod 0 state 1: "PAGEDOWN"
  = press (index 28953) => input event 146
SDL key sym 281 mod 0 scancode 121 state 0
--> key_code 281 key_mod 0 state 0: "PAGEDOWN"
  = press (index 28953) => input event 146
It looks right to me. I was pressing numeric 7 (HOME), 9 (PAGEUP) and 3 (PAGEDOWN).
mr_a500 is offline  
Old 17 December 2012, 18:32   #16
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
This is what happens when I press keypad "7", both with numlock on and off on Mac:
Code:
SDL key sym 263 mod 0 scancode 89 state 1
--> key_code 263 key_mod 0 state 1: "KP7"
  = press (index 28935) => input event 192
The first line is what FS-UAE gets from SDL.
The line beginning with --> shows the calculated values FS-UAE will use further, along with the "FS-UAE" key name ("KP7" in this case), and the last line shows the Amiga input event that is generated, if any.

(It is true that FS-UAE tries to use physical key mapping, but the keys on the numpad (on OS X) actually uses the translated key codes from SDL, since these keys are generally not changed by keymaps).
FrodeSolheim is offline  
Old 17 December 2012, 18:36   #17
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Actually, when I think about it, since the keys on the numpad uses the translated key codes in this case, it is probably affected by the num lock key... (num lock on my PC keyboard here does not have any effect on my Mac laptop).

The reason I left out the numpad from the "scancode" mapping was probably because I don't have a real Mac keyboard, and thus wouldn't know if the scancodes would be different from my PC keyboard...
FrodeSolheim is offline  
Old 17 December 2012, 18:36   #18
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
OK - I got it. I have to do "keyboard_key_home = action_key_np_7". I was doing keyboard_key_kp7 before.

That solves that little problem. Now I just have the modifier problem. I'll check with the debug.

Then I have to get Help mapped to Amiga Help. (yes, I have an actual "Help" key on my IBM AT keyboard! ...oh the thrill of it... )
mr_a500 is offline  
Old 17 December 2012, 18:45   #19
mr_a500
Amiga-based Cyborg
 
mr_a500's Avatar
 
Join Date: Dec 2004
Location: Canada
Posts: 808
Quote:
Originally Posted by FrodeSolheim View Post
This is what happens when I press keypad "7", both with numlock on and off on Mac:
Code:
SDL key sym 263 mod 0 scancode 89 state 1
--> key_code 263 key_mod 0 state 1: "KP7"
  = press (index 28935) => input event 192
That's weird because mine returns "HOME". So that means if I had a "normal" Mac keyboard, the keys would have worked... normally.

Thanks for checking!
mr_a500 is offline  
Old 17 December 2012, 18:46   #20
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
For reference, here's what happens if I use the option keyboard_key_shift_q = action_key_f1 and press Q while either left or right shift key is pressed (on Mac):
Code:
- key code set to 113 (was 113) based on scancode 12
--> key_code 113 key_mod 3 state 1: "Q"
  = press (index 30833) => input event 129
(The "Q" means that the host Q key was pressed, and 129 is the input event for Amiga F1 key).

Regarding the HELP key, please send me the output while you press it
FrodeSolheim is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using multimedia / volume keys while in FS-UAE PHabermehl support.FS-UAE 13 23 October 2013 16:24
Ctrl + Function Keys no longer working in 2.4.0+? killergorilla support.WinUAE 4 20 September 2012 15:53
FS-UAE quicksave keys? soup_de_grace support.FS-UAE 2 09 September 2012 17:31
amiga format #30. Function keys not working on menu lost_lemming support.Apps 6 24 February 2010 14:51
Function Key editor lopos2000 request.Apps 2 04 August 2006 14:18

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 10:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10056 seconds with 13 queries