Thanks a lot for the xev output. I think I'm gonna buy the HHKB JP and give it a try...
Regarding the HHKB Pro 2: despite the two keys at the right and left of the spacebar having the exact same symbols printed on them, they do send different keycodes. On every keyboard I owned I always used one as Alt and the other as AltGr. But seen that the HHKB JP is so different, I was wondering if maybe there was a gotcha
I thought back to the HHKB Pro2 keyboard the moment how you said about how the there is Alt and AltGr. I suppose Alt_L and Alt_R have their own individual keycodes hence one could easily remap either of them as AltGr or as a normal Alt_{L,R} button respectively. It is understandable that there is a need to have AltGr in notable ISO keyboard layouts as it allows one to input region specific letters such as "€" for instance.
Not exactly an expert on standards but I somehow do believe the JIS layout loosely follows the ISO layout. The Enter key is still shaped like the letter "7" whilst I guess the left shift key length is swapped with right shift key as in instead of having an extra key before the letter "z" on a regular QWERTY layout for ISO keyboard, there is an extra key before the right shift key for the JIS layout. At least for the HHKB JP the case is like this. The backspace key length is shortened to accomodate an extra key in between. The bottom row, well that is evident.
shortened spacebar to accomodate extra modifiers specific to the Japanese language.
Some interesting links that I thought it was worthy to point out but you may probably have been aware of this:
I suppose it would be really weird if both Alt keys for instance shared the same keycode whilst placed on different sides of the spacebar. Conversely I can see your point of concern is. However I personally do believe there probably are not many keyboards out there that would have two Alt sharing the same keycode whilst using either ISO or JIS layout.
Normally virtual terminals are accessible via Ctrl+Alt+F{1-6,8-12} and X normally sits on Ctrl+Alt+F7
Yup, by default the first is on Ctrl+Alt+F7. That said on my setup, virtual text terminals stop at F6 by default (there's nothing at first on CTRL+Alt+F8)... And the second X, if any, is on Ctrl+Alt+F8 etc. (say if I started it with "startx -- :1", which I used to typically do after doing CTRL+Alt+F2).
(Pretty much a stock Debian here)
Yup most distros and I would probably go as far as saying that also most basic setups would have nothing past Ctrl+Alt+F7. There are some distros that probably would make use of the spare terminals such as SuSE or IPCop outputting kernel logs through Ctrl+Alt+F12. SuSE would probably use Ctrl+Alt+F11, and even Ctrl+Alt+F10 for stuff like lsmod output (to be monitored if I remember correctly) and can't recall what the other blank terminal was used for. I like to point out here that SuSE is no longer called as such, some people may like to kindly refer them as OpenSUSE, but when I used SuSE it was more of a commercial variant (it was not exactly free, they had Free and Pro versions). I haven't properly tried OpenSUSE so I don't know if the same traditions of making use of those other terminals still carried over from SuSE.
I have setup my Archlinux to be quite similar in that respect, making use of some of the blank terminals. dmesg on the last one as usual, iptables output on one and some other thing I was running on F10 but I can't remember now (lol).
That said it would still leave F8 and F9 blank in which I could easily spawn an X session or two to fill those gaps. However I can't access them so it makes the exercise rather moot.
It was still working right up until I started using HHKB JP and remapping keys. That is where everything became a mess, no shortcuts, certain keys not working, no access to virtual terminals (it was working intermittently on certain keys).
I do all my remapping using xkb. For years I used xmodmap but then I read that nowadays xkb is what should be used... It's not that complicated: you dump a layout which you like as a start (I took the french AZERTY layout, because it has AltGr already well configured) to an .xkb file and then you modify it to fit your need (for example I swapped Alt and AltGr and transformed the AZERTY back to QWERTY, etc.). I used the french layout as a start because I found it easier than starting from a layout which didn't have AltGr+... producing level 3 iso shift and try to add it myself.
Now I'm not recommending anyone to use my setup but, to give an example, using xbk to swap Alt and AltGr means changing exactly two lines in the .xkb config file.
I'd say that under it's Rube Goldberg-like machinery xkb is not that complicated so you may want to give it a try too.
Overall it's easy: as soon as I mess something, I simply call the last working setup, say "xkbcomp ~/blablabla.xkb $DISPLAY" and try something else.
I do still use xmodmap to check (and sometimes clear / modify) modifiers (xmodmap -pm).
Maybe you could try starting from the japanese layout and then mod it to your will? (I take it that it's what I'm gonna do once I get my HHKB JP: all the modifiers should be correctly configured if I start from the japanese layout, which I'd then "simply" transform back to regular QWERTY).
I have sort of started looking briefly at xkb after being referred to the same thing twice by two people (and now with you included that makes three haha). After briefly loosely following Archwiki on xkb and dumping the current configuration I started briefly browsing over the information to see if I can get a better meaning of it all. It turns out that functions were abbreviated.
Here is an example of what I mean:
<RCTL> = 105;
<KPDV> = 106;
<PRSC> = 107;
<RALT> = 108;
<LNFD> = 109;
<HOME> = 110;
versus...
keycode 105 = Control_R NoSymbol Control_R
keycode 106 = slash NoSymbol slash
keycode 107 = Print Sys_Req Print Sys_Req
keycode 108 = Alt_R NoSymbol Alt_R
keycode 109 = Linefeed NoSymbol Linefeed
keycode 110 = Home NoSymbol Home
Although not having sunk in deeply on the xkb config but having noticed that I guess it looks like I'll have to learn and adhere to the new layout should I want to use xkb.
HaaTa also gave me a hint on ISO_Shift_Level_3 as a hint when dealing with xmodmap and multiple layouts when trying to alleviate the limited number of modifiers (via mod{1-5}) as there are more Shift key themselves have more than one level. Though ultimately I guess I need to move off xmodmap and xkb.
Yeah I know it is not exactly complicated, but just the new syntaxes sort of throw me off I guess. xkb does seem to be far more flexible than dealing with xmodmap when it comes to adding language groups I have sort of noticed. That was something that HaaTa pointed out as well in which I guess that would be one other way for me to look at things.
My original plan with my xmodmap setup was to add for starters HHKB JP layout which is basically the Japanese layout as indicated on the keyboard. That was basically sorted out as what you have indicated. For me there are no plans to really slowly make my HHKB JP layout to be more QWERTY. Instead I plan to ultimately add real Japanese outputs via something like this (obviously this will never work with xmodmap but I am just making a mock up image of my goal):
keycode 34 = a A ち チ
In other words I am basically forcing Japanese input without the need for me to strictly go through IME route. There is nothing wrong with IME (once you get it working right) but before that time, it can be a pain when some of the programs fails to accept IME input and the need to press a few keys to enable Japanese language input for instance.
I may probably have to do the same thing as well for Chinese (yay! more fun...)
Yeah the VNC is another way to set it up but right now such case seems a little unlikely and I used to recall VNC was really sluggish. So throwing KDE in there it may make it really sluggish so much to give others poor impression of what linux is meant to be.
Over the network I find VNC so slow as to be nearly unusable... But locally I think it's really fine: I've got a 1920x1200 monitor and just tried to play 3 movies simultaneously inside the Xvnc and viewing them in my "real X" (the one a :0) using vncviewer. Seems fine... I'm not sure KDE or any other WM would change much: vnc is VM agnostic I think ^ ^
My machine is not a speed daemon: just a Core i5-3450s (low TDP, pretty quiet) with 4GB of RAM.
You could always try it and see what gives (for what it is worth my heavy-remapped setup seems to work fine inside the vncviewer: so apparently no keymappings / shortcuts issues that would be due to VNC)
My machine is ancient hahaha. Core(TM)2 Duo E6750 with 8GB DDR2-SDRAM. Though I haven't tried running VNC locally so I guess it maybe interesting if and when the time comes.
Whilst you are here, how is TMK board going? I am still eager to buy that TMK firmware (for HHKB) off you! Teensy board may also work but I rather a more elegantly designed replacement controller board for HHKB (ironically considering that your controller board looks like an ideal "drop-in" replacement).
In next revision PCB I'll add initial support of HHKB JP. But I can't update firmware to support JP 'cause I dont' have it in hand. But some JP user is working on firmware job now. If you are interested watch my controller thread.
Cool! I cannot wait. I have been watching and bookmarked a whole bunch of links relating to your TMK project though I couldn't recall much new updates on the TMK PCB itself apart from some people got the board off you and apparently you ran out and have to buy more or something.
Yeah I know you don't have HHKB JP haha, real people don't need HHKB JP just as many Youtube videos I have seen that not many Japanese people themselves uses HHKB JP. The idea of me purchasing HHKB JP was to sort of kill as many birds as I can with one stone. Inevitably that came with lots of catches but I guess in either way I will need to face up with them. As the old Japanese saying goes,"七転び八起き" (Literal English translation: seven fall down, eight stand up. Translated to proper English: Fall down seven times, stand up eigth time. In other words persistence/perseverance pays off.)
I am not good at programming but I'll try to help out where I can on your project. I also tried reaching you on IRC but you don't speak much on there hahaha (besides my handle on forum is different on IRC but that is another story..). Anyway I am still very interested in your project regardless, a firmware replacement that will ultimately never require one to configure their machine/computer like hell.
Here is a bug from the KDE bugzilla that seems related to the issue:
https://bugs.kde.org/show_bug.cgi?id=318904
Looking at your xev output, the Mod2 modifier is set (state 0x10). As far as I understood, if you have no Num_Lock key, applications do not understand the meaning of Mod2, and might behave strangely.
Welcome to the geekhack forums! Thanks for the link as well.
The link does contain some useful information, notably in the case of where "Martin Gräßlin" is noted. I was trying to get a hold of him on IRC but he comes on different hours of the day and only for a short time (thankyou very much timezones...) but now I know the issue is not specific to KWin but some other component.
Anyway it seems that in order for me to try and replicate the issue I will need to first migrate onto xkb at any given rate or I might get frowned for still using the relic xmodmap (lol). On my currently working config, it shows as state: 0x0 for Alt and 0x8 for Tab. I have not swapped the Tab key yet but I could try that. Though again might be better if I first migrate onto xkb then try disabling the lock keys (except for Caps_Lock which I do have a key for but no LED light to indicate whether or not it is on). Thinking of it I do believe at the time of the testing, my full sized keyboard did have the Num_Lock LED on when I was testing out the keys for TacticalCoder. The state 0x0 is now with numlock off. Trying with it on, an extra digit (1) has been added. So instead of 0x0 for Alt with numlock off it becomes 0x10 when it is on, same thing with Tab key, 0x18 instead of 0x8.
The strange thing conversely is that had I not define Num_Lock key (along with Scroll_Lock, I do not know which one fixes the issue. Most likely Num_Lock as I did see the spike in CPU usage via gkrellm). The shortcuts does not work for most of the stuff on the global level as well as yakuake. Stuff like Alt+F2 does not bring down the Krunner and when pressing F12 it does not bring the yakuake screen down. Ironically pressing the F12 key when there is no Num_Lock set will print out "4~" on the terminal but won't hide yakuake.
The issue seems to be heavily tied on the Num_Lock issue. Absence of Num_Lock being defined makes shortcuts on certain things behave erratically conversely they stop behaving erratically when Num_Lock key gets artificially defined and bound.
I have also tried using numlockx to turn the numlock on and off, even if I went and disabled my other keyboard (a full sized keyboard with all the lock keys as well as LED on all the lock keys) numlockx does not report any issues. I disabled my other keyboard via xinput disable <device name>. Also no issues with shortcuts regardless if numlock was set to either on or off.