Custom Keyboard Layout
Glen Walker (2585) 469 posts |
I have a feeling I have asked about something like this before but having had a quick dig around using the search facility of the forum I quickly got lost looking at other interesting things and never found what I wanted. Anyway, since I’m now moving away from a desktop setup and going to using my Pi plugged into the TV with a slightly odd wireless keyboard and mouse and in the interim I have got very used to our MacBook Air keyboard with its own take on the UK layout (I have even made my Windows computer at work have the same layout) I have been wondering if I could modify the layout of the keyboard in RISC OS too? Basically I’ll just be swapping a few keys around, like putting the @ symbol above the 2. The wireless keyboard does have a cross between UK/ISO and US layouts so I could in theory use a US layout but I still want to be able to get £ by shift-3. On Windows there is a tool called “Microsoft Keyboard Layout Creator 1.4” which is really quite good and on Linux there are a variety of ways to do it—anyone know anything in RISC OS that can be used to swap key functions around at will? |
RISCOSBits (3000) 131 posts |
I believe KeyMapper will do this fairly easily. There’s some information about the different key numbers here A front end to create the Obey file would be really useful – this could even be some sort of keyboard image? |
Glen Walker (2585) 469 posts |
Thanks! I might get some time to play with it tomorrow night.
Now that sounds like it would be right up my street! Maybe that should be put into my poll? ;—) |
Kevin (224) 286 posts |
If a virtual keyboard is OK for you then my Vkeyboard allows multiple keyboard layouts. https://kevsoft.wordpress.com/2018/01/14/create-and-edit-comes-to-vkeyboard/ |
Glen Walker (2585) 469 posts |
I was actually after something that would detect when I pressed a certain key and then insert a different character into whatever I am typing. For example I am now very used to typing “shift+2” to get @ but the keyboard I am currently using produces ". I know that this is the more normal UK layout but once I got used to the " and @ keys being switched it felt an awful lot more natural for some reason. I’ve looked at KeyMapper and I’m not sure it will help because it seems to be all about swapping whole keys around so if I did that the 2 key and ’ key would be swapped. |
Theo Markettos (89) 919 posts |
There was originally a tool called !IKHG (International Keyboard Handler Generator) that would generate keyboard driver modules. I think it means you have to compile your own InternationalKeyboard module though (but you can softload). PS: Inuit? |
Glen Walker (2585) 469 posts |
Cool thanks – looks like it might be fun! Also could be of use if I ever finish my hardware keyboard projects (which I abandoned due to the cost involved…)
What’s wrong with the Inuit having their own keyboards? I’m more curious about the Welsh one – how is that different from UK? |
Clive Semmens (2335) 3134 posts |
Welsh: â á ê ë î ï ô ö û ŵ ŷ – don’t know what keyboard layout is used to achieve this, though. Typewriters used to have dead key accents on shifted number keys. |
Chris Evans (457) 1614 posts |
I’m sure many people would be very grateful if someone could write an InternationalKeyboard module that would use a user generated file that had the mappings. |
nemo (145) 2437 posts |
I always intended to. Even got the name and filetype allocated. I’m too busy at the moment though. |
Glen Walker (2585) 469 posts |
Want me to take a look? I haven’t yet sold my soul to the NetSurf developers so it could be my “thing to do next”…? edit: I just read a bit about modules and am somewhat confused, aside from the old PRM chapter on it—which I will have a read of tonight if I get time—any good places to teach myself about modules in RISC OS? |
Clive Semmens (2335) 3134 posts |
Me, for one. I used to use IKHG (Internationsl Keyboard Handler Generator) back in RPC days to make proper custom keyboard layouts, not just keymap swaps. Sadly it doesn’t work on Pi/RO 5. |
Theo Markettos (89) 919 posts |
Indeed, it’s rather surprising that, when InternationalKeyboard (IntKey to its friends) was revamped for Unicode support, that the tables weren’t made loadable. I suspect it’s to do with the work being done for the STB market (where everything is compiled into ROM), and a wish to have something working if disc isn’t available. But, looking at the code, it doesn’t seem a huge ask to convert the static-at-compile-time tables into a means of dynamically adding tables – even if compiling the tables (keygen) is done offline.
I fully support the right of the Inuit to have their own keyboard layout. However I might have expected them to come somewhere in the queue behind small countries like, I don’t know, China. |
Colin Ferris (399) 1751 posts |
To Glen For practical info about RO modules – have a look around ’Rick’s’ site. If you are into ‘C’ – there is a full demo/run down of module ‘USBeep’. |
Clive Semmens (2335) 3134 posts |
The are issues not only about the size of countries, but also the difficulty of coping with their issues. It’s not unreasonable for little countries with small problems to hope for solutions ahead of countries, however large, with massive problems. |
David Pitt (3386) 1248 posts |
The Mac version of VRPC comes with a small freeware BASIC prog that generates a module which makes an excellent job of translating the Mac keyboard for use with RISC OS. See Mac Keyboard Driver Release 1 |
Glen Walker (2585) 469 posts |
Cool! Will do!
That looks like an excellent little program I could use while I’m developing my own module! Thanks! |
Glen Walker (2585) 469 posts |
OK, I have read a bit more about modules and am ready to start planning some software. What do you think of this approach: 1. A GUI layout generator that acts as a visual aid to generate config files or 2b. An entirely new module that interfaces with the existing IntKey module somehow If I were to do 2a. would I clone the repository at: https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Internat/IntKey/ I had a dig around in the source tree in the link above but couldn’t find any licence file or info (admittedly I am usually rubbish at spotting things) so not sure if I would be allowed to do that though? |
Steffen Huber (91) 1945 posts |
It looks like it is in the “Castle” part of the source tree, so under the standard Castle licence, which means “if you sell it we want money and you don’t need to feed back changes immediately, if you don’t sell it distrbute it with the changed source and feed back your changes”. |
Rick Murray (539) 13418 posts |
You’ll need to do some deeper digging – the current keyboard handling does not work1 with the various extended keys on modern keyboards, so this probably ought to be seen to prior to extending the keyboard layout stuff2. 1 Effects seem to range from “nothing” to “stiffage”. 2 Not strictly necessary, but it implies having to modify the higher level keyboard handling again once these additional keys are available… |
Glen Walker (2585) 469 posts |
Would that be media keys and such like? Or is it the Fn layer? Maybe I’m boring/weird but most of my keyboards are fairly standard PC ones and don’t have any extra keys! edit: I just noticed the guy sitting next to me has a bunch of G keys as well as F keys on his keyboard…all the way up to G18! I guess there is some fancy software to configure them as macros… |
Stefano Bertinetti (2512) 21 posts | |
Glen Walker (2585) 469 posts |
Well yes…but Rick did say modern ! As one-time heavy Emacs user I should probably blame the Space Cadet for all the weird gymnastics I used to have to do with my left hand… I also had a few extra keys on my own keyboard layouts but was always intending on doing the actual mapping in hardware/firmware so when you pressed them the OS got a fairly normal key signal…I was just wondering what keys Rick meant because then I can write the software to cater for them (presumably after rushing out to get a shiny new (modern) keyboard to test it all!) |
Chris Evans (457) 1614 posts |
As having it included in the official ROM builds will be best can I suggest asking ROOL which they would prefer? |
Glen Walker (2585) 469 posts |
Good idea! I should probably ask Nemo as well because I wouldn’t want to step on anyone’s toes… edit: Nemo (if you see this!): I’ve been on your website but I don’t use Twitter, just e-mail and this forum really… please let me know if you have any thoughts about my working on a module for InternationalKeys at: http://xsltpro.co.uk/content/contact |