07 December 2012, 20:45 | #1 |
Amiga-based Cyborg
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. |
08 December 2012, 00:05 | #2 |
FS-UAE Developer
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 - 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. |
08 December 2012, 00:26 | #3 | |||
Amiga-based Cyborg
Join Date: Dec 2004
Location: Canada
Posts: 808
|
Quote:
Quote:
Quote:
Last edited by mr_a500; 07 November 2018 at 16:52. |
|||
08 December 2012, 01:24 | #4 |
FS-UAE Developer
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 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 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. |
08 December 2012, 03:08 | #5 |
Amiga-based Cyborg
Join Date: Dec 2004
Location: Canada
Posts: 808
|
Excellent. Thanks!
|
10 December 2012, 21:05 | #6 | |
Amiga-based Cyborg
Join Date: Dec 2004
Location: Canada
Posts: 808
|
Quote:
(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.) |
|
11 December 2012, 16:59 | #7 | |
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
Quote:
Code:
keyboard_key_shift_q = action_key_f10 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. |
|
11 December 2012, 18:02 | #8 |
Amiga-based Cyborg
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. |
11 December 2012, 18:10 | #9 |
FS-UAE Developer
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 |
14 December 2012, 01:28 | #10 |
Amiga-based Cyborg
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.
|
16 December 2012, 22:20 | #11 |
Amiga-based Cyborg
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 |
17 December 2012, 17:33 | #12 |
FS-UAE Developer
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). |
17 December 2012, 17:51 | #13 | |
Amiga-based Cyborg
Join Date: Dec 2004
Location: Canada
Posts: 808
|
Quote:
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. |
|
17 December 2012, 18:16 | #14 |
FS-UAE Developer
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 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). |
17 December 2012, 18:31 | #15 |
Amiga-based Cyborg
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 |
17 December 2012, 18:32 | #16 |
FS-UAE Developer
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 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). |
17 December 2012, 18:36 | #17 |
FS-UAE Developer
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... |
17 December 2012, 18:36 | #18 |
Amiga-based Cyborg
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... ) |
17 December 2012, 18:45 | #19 | |
Amiga-based Cyborg
Join Date: Dec 2004
Location: Canada
Posts: 808
|
Quote:
Thanks for checking! |
|
17 December 2012, 18:46 | #20 |
FS-UAE Developer
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 Regarding the HELP key, please send me the output while you press it |
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 |
|
|