All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiangfu Liu <xiangfu.z@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: Fn + [KEYS] question
Date: Thu, 17 Sep 2009 01:24:25 +0800	[thread overview]
Message-ID: <4AB11F49.6060308@gmail.com> (raw)
In-Reply-To: <20090916163305.GB4970@core.coreip.homeip.net>

Dmitry Torokhov wrote:
> On Wed, Sep 16, 2009 at 10:44:01PM +0800, Xiangfu Liu wrote:
>> Xiangfu Liu wrote:
>>> Hi Dmitry
>>>
>>>>>  thanks for the reply.
>>>>> see [1], I change the [Red arrow] key to [ALTGR] then I can easy change the 
>>>>> defkeymap.map. make all the red keys work.
>>>>>
>>>>> but for the [Blue Fn] key. I don't know how to make it work in keymap?
>>>>> there is [SHIFT] [CONTROL] [SHIFT] [ALTGR] four modifier keys.
>>>>> all used. so I can not may the [Fn] to those four modifier keys.
>>>>>
>>>>> can I make the leftAlt and rightAlt generate different keys?
>>>>> like:
>>>>>  LeftAlt + 'U' = Alt + 'U'
>>>>>  RightAlt + 'U' = '7'
>>>>>
>>>> Keyboard driver supports 9 modifiers total, you should be able use one
>>>> of these for your numeric buttons.
>>>>
>>> oh. can you give me some tips on the other modifiers.
>>> how to define them? 
>>> can I just change the defkeymap.map file?
>>> or I must change the source code?
>>>
>> Hi Dmitry I found this[1] in the 'man keymaps', three are 9 modifiers.
>> but the in defkaymap.map, there is alwasy like:
>>
>> control keycode  53 = Delete
>>
>> there is no ctrll in the defkeymap.map.
>> how to implement this?
>>
>> ShiftL + u = U
>> ShiflR + u = 7
>>
> 
> The same as with AltGr you need to do
> 
> keycode XX = CtrlR
> 
> and then
> 
> keycode YY = u
> shift keycode YY = U
> ctrlr keycode YY = seven
Hi Dmitry
thanks for the reply. I test this, it's not work. 
----------
$ loadkeys -m defkeymap.map > defkeymap.c && rm defkeymap.o
loadkeys: defkeymap.map:71: adding map 64 violates explicit keymaps line


I look into the keyboard.c,  in the kbd_keycode function
seems this "keysym = key_map[keycode];" make the CtrlL and CtrlR 
map to the Ctrl. so I change the keyboard.c[1] code like:

1. when press CtrlR pass, change back the Ctrl to CtrlR. 
2. in the k_shift function set a sign [shift_right] to 1
3. change the CtrlR to Ctrl in k_shift funtion. other code 
   will only know the Ctrl. not the CtrlR. 
4. when press "u" and [shift_right] is true change the keysym to "1"
   others are same.

_I think the code is not good. so if someone have any idea._
_just let me know._

thanks.


[1]
-----------------------
@@ -800,7 +805,15 @@ static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
                        clr_vc_kbd_led(kbd, VC_CAPSLOCK);
        }
 
+       if (value == KVAL(K_CTRLR)) {
+               shift_right = 1;
+               value = KVAL(K_CTRL);
+       }
+
        if (up_flag) {
+               shift_right = 0;
                /*
                 * handle the case that two shift or control
                 * keys are depressed simultaneously
@@ -1284,6 +1297,20 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
        if (raw_mode && type != KT_SPEC && type != KT_SHIFT)
                return;
 
+       if (keysym == 61461 && shift_right == 1)//61461 is CtrlR + U
+               keysym = 61489;  		//61489 is "1"
+       if (keysym == 61449 && shift_right == 1)
+               keysym = 61490;
+       if (keysym == 64367 && shift_right == 1)
+               keysym = 61491;
+
+       if (keycode == KEY_RIGHTCTRL) 
+               keysym += 5;

//KEY_CTRL = 2
//KEY_RIGHTCTRL = 7 form the keyboard.h file

        (*k_handler[type])(vc, keysym & 0xff, !down);
 
        param.ledstate = kbd->ledflagstate;


> 
> Let me know if this works.
> 


-- 
Xiangfu Liu
Email: xiangfu at qi-hardware dot com
Web: http://www.qi-hardware.com

  reply	other threads:[~2009-09-16 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16  7:24 Fn + [KEYS] question Xiangfu Liu
2009-09-16  7:32 ` Dmitry Torokhov
2009-09-16  7:43   ` Xiangfu Liu
2009-09-16  8:06     ` Dmitry Torokhov
2009-09-16  9:25       ` Xiangfu Liu
2009-09-16 14:44         ` Xiangfu Liu
2009-09-16 16:33           ` Dmitry Torokhov
2009-09-16 17:24             ` Xiangfu Liu [this message]
2009-09-16 17:40               ` Dmitry Torokhov
2009-09-17  2:31                 ` Xiangfu Liu
2009-09-18  5:45                   ` Dmitry Torokhov
2009-09-18  6:45                     ` Xiangfu Liu
2009-09-18  6:49                       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AB11F49.6060308@gmail.com \
    --to=xiangfu.z@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.