Professional Web Applications Themes

keyboard conundrum - Sun Solaris

Alan Coopersmith <alancalum.calberkeley.org> wrote in message news:<bd5tvj$2omc$3agate.berkeley.edu>... > phil+s3bolthole.no-bots.com writes in comp.unix.solaris: >... > |I say this, because according to xev, the backspace key is keycode 49. > |however, grepping through the files in the keytables dir above, there is > |no file that maps keyboard 49 to backspace. yet, backspace actually works > |and gives the right keysym! > > The files in that directory show the USB keycode value - X adds an > offset to this to make room for the mouse buttons in the bottom of > the keycode range returned. If not using XKB, the ...

  1. #1

    Default Re: keyboard conundrum

    Alan Coopersmith <alancalum.calberkeley.org> wrote in message news:<bd5tvj$2omc$3agate.berkeley.edu>...
    > phil+s3bolthole.no-bots.com writes in comp.unix.solaris:
    >...
    > |I say this, because according to xev, the backspace key is keycode 49.
    > |however, grepping through the files in the keytables dir above, there is
    > |no file that maps keyboard 49 to backspace. yet, backspace actually works
    > |and gives the right keysym!
    >
    > The files in that directory show the USB keycode value - X adds an
    > offset to this to make room for the mouse buttons in the bottom of
    > the keycode range returned.
    If not using XKB, the offset is
    > (8 - MINSCANCODE) as noted in the comments in the keytable.
    So in theory, if xev shows the backspace key is X keycode 49, and then
    since US6.kt.Z shows 42 RN XK_BackSpace, then the offset is 7

    I shall give that a try. Thanks.

    [huh. using that math, since xev says 'bar' aka pipe, is keycode 57,
    then that means the keytable for this keyboard would need an entry for
    it at 50, whereas US6 has it at 49. off-by-one, durn :-/ ]


    Do you know of any precompiled, with-the-os way to probe the keyboard
    to find out the "layout" value? Otherwise, if you have some source
    for a util lying around, it would be nice if you posted it. I want to
    know which entry for keytable.map I'm going to have to override for
    this thing.

    Or is the layout set only via kdmconfig, on x86? If so, where is it
    stored?
    I cant find where kdmconfig is getting its list of keyboards from.
    oh, waitaminit. seems that I have to create
    devdata/keyboards/somename.kbd
    AND add an entry to devdata/iddbdir/keyboards.idb,
    AND then add an entry for keytables/keytable.map
    AND the copy and modify US6.kt.Z to somename.kt.Z

    ugh.
    Philip Brown Guest

  2. #2

    Default Re: keyboard conundrum

    [email]phil.googlenewsbolthole.com[/email] (Philip Brown) writes in comp.unix.solaris:
    |Do you know of any precompiled, with-the-os way to probe the keyboard
    |to find out the "layout" value? Otherwise, if you have some source
    |for a util lying around, it would be nice if you posted it.

    /* Copyright Sun Microsystems, Inc. All rights reserved. */
    #include <stdio.h>
    #include <unistd.h>
    #include <sys/ioctl.h>
    #include <sys/kbio.h>
    #include <fcntl.h>

    #define dev_name "/dev/kbd"

    int main()
    {
    int fd = open (dev_name, O_RDWR, 0);
    int type; /* Type of keyboard */
    int layout; /* Layout of keyboard */

    if (fd < 0) {
    fprintf(stderr, "Opening %s", dev_name);
    return -1;
    }

    if (ioctl(fd, KIOCTYPE, &type) < 0) {
    fprintf(stderr, "KIOCTYPE failed");
    return -1;
    } else {
    printf("Type: %d\n", type);
    }

    if (ioctl(fd, KIOCLAYOUT, &layout) < 0) {
    fprintf(stderr, "KIOCLAYOUT failed");
    return -1;
    } else {
    printf("Layout: %d\n", layout);
    }
    return 0;
    }

    --
    __________________________________________________ ______________________
    Alan Coopersmith [email]alancalum.calberkeley.org[/email]
    [url]http://www.CSUA.Berkeley.EDU/~alanc/[/url] aka: [email]Alan.CoopersmithSun.COM[/email]
    Working for, but definitely not speaking for, Sun Microsystems, Inc.
    Alan Coopersmith Guest

  3. #3

    Default Re: keyboard conundrum

    On Tue, 24 Jun 2003 01:26:53 +0000 (UTC), [email]alancalum.calberkeley.org[/email] wrote:
    >[nice simple test prog to tell keyboard layout/type]
    great! thanks a lot. I now have a working pipe key!
    [on console, anyways. my plan to auto-remap keys in X isnt turning out
    quite as well :-( ]

    can you tell me how the layout number gets set for USB console keyboards,
    though?


    --
    [url]http://www.blastwave.org/[/url] for solaris pre-packaged binaries with pkg-get
    Organized by the author of pkg-get
    [Trim the no-bots from my address to reply to me by email!]
    S.1618 [url]http://thomas.loc.gov/cgi-bin/bdquery/z?d105:SN01618:D[/url]
    [url]http://www.spamlaws.com/state/ca1.html[/url]
    Philip Brown Guest

  4. #4

    Default Re: keyboard conundrum

    phil+s3bolthole.no-bots.com (Philip Brown) writes:
    > can you tell me how the layout number gets set for USB console keyboards,
    > though?
    See the /usr/lib/set_keyboard_layout shell script (on Solaris x86),
    which is run from /etc/rcS.d/S33keymap.sh (/etc/init.d/keymap) very
    early at system startup time.

    I think Sun USB keyboards define a proper "country code" in the usb
    device descriptors, so set_keyboard_layout isn't needed. But the
    typical PC USB keyboard doesn't and needs the set_keyboard_layout
    workaround. If you connect a PC USB keyboard (with a non US keyboard
    layout) to a SPARC, you'll soon notice that
    /usr/lib/set_keyboard_layout from S-x86 is missing on S-SPARC :-)
    Juergen Keil Guest

Similar Threads

  1. Module naming conundrum
    By Jim Schneider in forum PERL Modules
    Replies: 1
    Last Post: March 10th, 10:45 AM
  2. update conundrum
    By Wants2learn in forum Macromedia ColdFusion
    Replies: 2
    Last Post: May 20th, 12:48 AM
  3. XML Socket - Header conundrum...
    By jog in forum Macromedia Flash
    Replies: 1
    Last Post: November 29th, 06:07 AM
  4. color conundrum
    By marita cummins in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 1
    Last Post: July 24th, 03:12 AM
  5. Clunky Cache Code Conundrum?
    By Jim Owen in forum ASP.NET General
    Replies: 4
    Last Post: July 3rd, 04:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139