Bug 31340

Summary: Support for Japanese keyboard Sanwa Supply Inc. Small Keyboard
Product: xkeyboard-config Reporter: Pander <pander>
Component: GeneralAssignee: xkb
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium Keywords: NEEDINFO
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch for review, see also line with TODO
Patch 0.4 against source
newer version, all descriptions are now "Sanwa Supply Inc. Small Keyboard KG3"
separate keypad definition, please review
fixed small typos, see also comments on previous patches
Patch on Ubuntu installed package: please help with fix
Patch on source: please review

Description Pander 2010-11-02 14:25:02 UTC
Please review the following patch Japanese keyboard Sanwa Supply Inc. Small Keyboard.

See http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3W and http://www.sanwa.co.jp/zooma/keybord/SKB-KG3SW/

In the geometry file is one question marked with TODO. Please provide feedback on this via this issue.
Comment 1 Sergey V. Udaltsov 2010-11-09 03:01:03 UTC
Did you forget to attach the patch?
Comment 2 Pander 2010-11-09 03:03:26 UTC
Apperantly. I will upload it now. Please review the patch before applying. Thanks.
Comment 3 Pander 2010-11-09 03:04:53 UTC
Created attachment 40143 [details] [review]
Patch for review, see also line with TODO
Comment 4 Sergey V. Udaltsov 2010-11-09 03:16:44 UTC
Review of attachment 40143 [details] [review]:

The patch changes the final files in rules subdirectory. Instead, the original files should be changed (base.xml.in, base.m_g.part)

The name convention for the model is awkward. Instead of sanwa_skb-kg3 I would use sanwaskbkg3 (see http://www.freedesktop.org/wiki/Software/XKeyboardConfig/Rules )
Comment 5 Sergey V. Udaltsov 2010-11-09 03:21:54 UTC
About your TODO, KP_Separator looks like a logical choice. But I cannot tell for sure. Could you try xev utility? What keysym does it produce when you press that key?
Comment 6 Pander 2010-11-09 03:33:00 UTC
(In reply to comment #4)
> Review of attachment 40143 [details] [review]:
> 
> The patch changes the final files in rules subdirectory. Instead, the original
> files should be changed (base.xml.in, base.m_g.part)

Ah, where do I find these? In the source files? Which URL to get for a proper patch?

> The name convention for the model is awkward. Instead of sanwa_skb-kg3 I would
> use sanwaskbkg3 (see
> http://www.freedesktop.org/wiki/Software/XKeyboardConfig/Rules )

OK, I will change this.
Comment 7 Sergey V. Udaltsov 2010-11-09 03:36:57 UTC
> Ah, where do I find these? In the source files? Which URL to get for a proper
> patch?
Just pick the xkeyboard-config source code. For example, here: http://www.x.org/releases/individual/data/xkeyboard-config/xkeyboard-config-2.0.tar.bz2

Or in git. See http://www.freedesktop.org/wiki/Software/XKeyboardConfig/Development
Comment 8 Pander 2010-11-09 03:39:12 UTC
(In reply to comment #5)
> About your TODO, KP_Separator looks like a logical choice. But I cannot tell
> for sure. Could you try xev utility? What keysym does it produce when you press
> that key?

KeyPress event, serial 33, synthetic NO, window 0x3e00001,
    root 0x112, subw 0x0, time 89217272, (855,482), root:(856,540),
    state 0x0, keycode 91 (keysym 0xff9f, KP_Delete), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x3e00001,
    root 0x112, subw 0x0, time 89217336, (855,482), root:(856,540),
    state 0x0, keycode 91 (keysym 0xff9f, KP_Delete), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

But it should not be KP_Delete. When you search the source files, there are
some comments on JPCM, that it should be used for evdev. But evdev is
deprecated now? So that is not the one to use.

See the URL in this bug report to view the keyboard photograph for the key.
Probably KP_Separator is correct for this Japanese centered dot, but I'm not an
expert. Can some expert on Japanese keyboards in this community advise on this?
Comment 9 Pander 2010-11-09 05:51:17 UTC
Created attachment 40147 [details] [review]
Patch 0.4 against source
Comment 10 Pander 2010-11-09 05:52:17 UTC
I have improved the patch a lot, since now it is against the source files. Please review it again.
Comment 11 Sergey V. Udaltsov 2010-11-09 06:12:36 UTC
The last patch is REALLY much better!

Since you provided symbols/jp(sanwaskbkg3), why don't you just map keycode 91 to whatever you think is right? If someone is unhappy, we can always fix it.

Evdev is far from being deprecated, to the best of my knowledge.
Comment 12 Pander 2010-11-09 06:29:01 UTC
Created attachment 40151 [details] [review]
newer version, all descriptions are now "Sanwa Supply Inc. Small Keyboard KG3"
Comment 13 Pander 2010-11-09 06:32:49 UTC
Thanks. Please review also the latest patch.

Do you have experience with launchpad PPA to build version 1.8-1ubuntu8 with this patch in order to do a proper test?
Comment 14 Sergey V. Udaltsov 2010-11-09 06:33:46 UTC
Good. One more question. Your mapping, other than a series of "include" lines, is mostly about keypad mapping. What's so special about keypad of that keyboard?
Comment 15 Sergey V. Udaltsov 2010-11-09 06:36:24 UTC
May be, one day I will put xk-c into my PPA.
Comment 16 Pander 2010-11-09 06:39:52 UTC
(In reply to comment #14)
> Good. One more question. Your mapping, other than a series of "include" lines,
> is mostly about keypad mapping. What's so special about keypad of that
> keyboard?

keypad(overlay1) and keypad(overlay2) map [ KP_Left, KP_6 ] on KP6, I only wnat
KP_6 to be mapped on KP6. I could not find any other existing keypad that
matches. You perhaps?
Comment 17 Pander 2010-11-09 06:52:40 UTC
(In reply to comment #15)
> May be, one day I will put xk-c into my PPA.

I'm going to try patching on Ubuntu source and upload it to my PPA.
Comment 18 Sergey V. Udaltsov 2010-11-09 07:42:14 UTC
> keypad(overlay1) and keypad(overlay2) map [ KP_Left, KP_6 ] on KP6, I only wnat
> KP_6 to be mapped on KP6. I could not find any other existing keypad that
> matches. You perhaps?
You're right. For modularity purposes, would it make sense to add new section 'nonav' to symbols/keypad and including it in symbols/jp? There is nothing Japan-specific in your keypad mapping IMHO - may be, other ppl could find it useful as well.
Comment 19 Pander 2010-11-09 09:40:56 UTC
(In reply to comment #18)
> > keypad(overlay1) and keypad(overlay2) map [ KP_Left, KP_6 ] on KP6, I only wnat
> > KP_6 to be mapped on KP6. I could not find any other existing keypad that
> > matches. You perhaps?
> You're right. For modularity purposes, would it make sense to add new section
> 'nonav' to symbols/keypad and including it in symbols/jp? There is nothing
> Japan-specific in your keypad mapping IMHO - may be, other ppl could find it
> useful as well.

See patch 0.6 for extra keypad. At this moment I'm stuck. One way or the other gnome-keyboard-settings is unable to offer this new keyboard. Before it was possible. Can you find any problems with it?
Comment 20 Pander 2010-11-09 09:42:00 UTC
Created attachment 40156 [details] [review]
separate keypad definition, please review
Comment 21 Pander 2010-11-09 09:44:23 UTC
(In reply to comment #20)
> Created an attachment (id=40156) [details]
> separate keypad definition, please review

Now I'm using only "sanwaskbkg3" and "Sanwa Supply SKB-KG3" as geometry, model, variant and symbol definitions. Perhaps in one of these settings something is wrong since gnome-keyboard-properties is unable to offer the keyboard defined in this new version :S
Comment 22 Pander 2010-11-09 09:57:02 UTC
Created attachment 40159 [details] [review]
fixed small typos, see also comments on previous patches
Comment 23 Pander 2010-11-09 12:01:16 UTC
Created attachment 40162 [details] [review]
Patch on Ubuntu installed package: please help with fix
Comment 24 Pander 2010-11-09 12:01:49 UTC
Created attachment 40163 [details] [review]
Patch on source: please review
Comment 25 Pander 2010-11-09 12:08:30 UTC
Sorry for the many patches but this is until where I can get. One patch on the source (please review) and one patch for installed Ubuntu Maverick package (please help with fix). This worked before but not any more :(

I have split geometry (sanwaskbkg3) and symbols (kana86) but gnome-keyboard-properties has problems with this:

This happens when I add the kana86 layout or the sanwaskbkg3 keyboard:


Error activating XKB configuration.
It can happen under various circumstances:
 • a bug in libxklavier library
 • a bug in X server (xkbcomp, xmodmap utilities)
 • X server with incompatible libxkbfile implementation

X server version data:
The X.Org Foundation
10900000

If you report this situation as a bug, please include:
 • The result of xprop -root | grep XKB
 • The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd


In /var/log/Xorg.0.log I find these lines:

[  2436.163] (EE) Error loading keymap /var/lib/xkb/server-F58B9650039D7539235025B20D25D21DB4B4A5AB.xkm
Comment 26 Sergey V. Udaltsov 2010-11-12 16:25:19 UTC
Your last patch had some typos: incluce instead of include. Fixed. Committed. Please check in git.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.