Announcement

Collapse
No announcement yet.

How to set xset to make keys click...

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to set xset to make keys click...

    guys,

    although i expect that 99.9% + of you loathe it when your keyboard has clicky keys, that is the one thing that i gotta have. i never watch the screen when i'm hacking away; i watch my fingers. somebody who lives in another country hacked out a key-click program based on one he has written for his son for another purpose. he was more than a bit nasty about it, but it works with some flaws.

    do any of you know why xset fails? i did a symlink to make kubuntu quit complaining that xset was not in /bin; i typed "% xset c on" along with a number of variants to turn up the sound to close to 100. still, all i hear is the xset program in python.

    when i was hacking on supercomputers using Sun, the command "click [on|off]" worked. that was many years ago. i have written my own click program in C, but have troubles with the F[unction] keys. nutshell, is there a simple program that i can alter {if necessary}? and/or why doesn't xset work? i have been trying it since i first used ATT Sys-3 on a 286 with xset around 1986. Nada.

    TIA, people!


    #2
    None that I know of. And, "xset c 100" doesn't work.
    https://bugs.launchpad.net/ubuntu/+s...y/+bug/1071836

    Neither does the SystemSettings-->Input Devices-->Keyboard setting.
    Last edited by GreyGeek; Oct 18, 2013, 06:46 PM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      port my faulty key click python script...

      Originally posted by GreyGeek View Post
      None that I know of. And, "xset c 100" doesn't work.
      https://bugs.launchpad.net/ubuntu/+s...y/+bug/1071836

      Neither does the SystemSettings-->Input Devices-->Keyboard setting.

      well, as i said above, my python script does work: keys have a nice THUNK. But there are error on the konsole. i am learning python to be able to port this to C. --i found one other python script, much shorter. the author says it works. dunno yet.

      Comment


        #4
        Originally posted by kline View Post
        well, as i said above, my python script does work: keys have a nice THUNK. But there are error on the konsole. i am learning python to be able to port this to C. --i found one other python script, much shorter. the author says it works. dunno yet.
        Post the Python script and I'll see if it can be converted to a Qt app.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          zip file

          Originally posted by GreyGeek View Post
          Post the Python script and I'll see if it can be converted to a Qt app.
          well, this works in that it produces a sour [[light]] click "tink" with ea keystroke, but on my KDE ubuntu there is no character echo, just error output and the "tink, tink, tink" with three keys. since i'm still learning python, i dont know where to begin debugging ... and i've debugged thousands of C/C+= programs over 35 years.

          i just bought a new small keybd so i dont have to hurt my hand; the keyboard is not in the List of keyboards. this keydb is a "penclic"
          and IIRC, it's got 88 keys.

          if i can figure out how to send a *.zip file, you'll have it!

          okay. looks like it should be there. One thing: you will need to install the sox utility. Good luck!
          Attached Files

          Comment


            #6
            Got it! Thanks!
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              well, hmmm...

              Originally posted by GreyGeek View Post
              Got it! Thanks!
              i searched the web yesterday and learned that you cant do anything with the "modifier" keys such as SHIFT, ALT, and
              CAPS LOCK, &c. no wonder i "c = getch()" failer to sound my click.wav file. so far, every other key on this non-std keyboard works (if i use the ncurses stuff). So:: how does my large python script create a click? { note that i dont understand this in any depth}, but in a file called "xlib.py", the author has


              def _setup_lookup(self):
              """Setup the key lookups."""
              for name in dir(XK):
              if name[:3] == "XK_":
              code = getattr(XK, name)
              self.keycode_to_symbol[code] = 'KEY_' + name[3:].upper()
              self.keycode_to_symbol[65027] = 'KEY_ISO_LEVEL3_SHIFT'
              self.keycode_to_symbol[269025062] = 'KEY_BACK'
              self.keycode_to_symbol[269025063] = 'KEY_FORWARD'
              self.keycode_to_symbol[16777215] = 'KEY_CAPS_LOCK'
              self.keycode_to_symbol[269025067] = 'KEY_WAKEUP'

              this is picked up by an audio function which plays the wav click.

              if you see anything here that would help my C program, please send up some smoke signals!

              Comment


                #8
                That looks like a reinvention of the "input.h" header file that Linux uses and that the author of that python script you gave me imported into his python script.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  Originally posted by GreyGeek View Post
                  That looks like a reinvention of the "input.h" header file that Linux uses and that the author of that python script you gave me imported into his python script.
                  it couldn't be because the python i posted to the forum was part of a large script that somebody custom hacked for me about three years ago. did you ever get the small script i enclosed to actuallw *work* it had a list of keyboards and my new (small) keyboard wasn't among them. when i read the READ.md file and because root and tried to exec main.py it hung up But it did make weak clicking noises. there was nothing echoed to stdout; there was only the strange click.

                  i'm going to follow this guy's code ans see what i can figure out. see why he has 8 wav files, {?}, and so on. meanwhile, if you have any ideas, please let me know!

                  thanks much.

                  Comment


                    #10
                    I looked at evdev.py it is what brought to my mind input.h at /usr/include/linux/input.h. Evdev lifts entire sections of code from input.h. One could create a c app which "#include input.h" and do the same thing without python. I was, before I retired almost 5 years ago, primarily a Qt/C++ programmer.
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment


                      #11
                      Intel 64bit assembler...

                      well, sounds like you really Are older than me! i partly dislocated my shoulder right after 9/11 and they saw fit to lay me off. {yes, i was disabled otherwise, but i was doing real work. mostly in OS test, in C, some in perl.}

                      the last two keys --no 3 keys. well, wait. i'm using ncurses. in a do-while loop i have gotten every keys to click except the modifier keys: shift, ctrl, alt. also caps lock. for that i need to find somebody who know intel assembly. if you have heard of the $100 laptop for [mostly] children. i have an EEE asus that runs at 1.6gigs and my python script is severely pokey. the eee-900a has a membrane keybd that the kiddie laptop must have. i have written a speech program for the 100-buck laptop for those whose speech is impaired. the speech program got broke. i'll figure that out later. first, i want to make the membrane keybd keys echo with a nice THUNK. or maybe a quiet thunk.

                      i only have a keyboard with my two old/used laptops. same with my intel boxes. i am afraid that my fingers might damage a touch screen... [never tried; dont want to damage anything!]

                      nutshell::

                      where, other that this forum, should i ask if anyone knows 32 or 64 bit assembler to let me know if i have pressed a modifier key? once this stuff works, i'll work on the volume control. then clean up curses. then get back to the speech program.

                      thanks for any ideas.

                      Comment


                        #12
                        Shifting to assembler isn't an easy task, and you'd have to possess a better understanding of the hardware at the BIOS, IRQ and port level. You'd lose all the advantages of g++ and libc6. Using C or C++ is much easier and better and for what you want to do will work just as well.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Originally posted by GreyGeek View Post
                          Shifting to assembler isn't an easy task, and you'd have to possess a better understanding of the hardware at the BIOS, IRQ and port level. You'd lose all the advantages of g++ and libc6. Using C or C++ is much easier and better and for what you want to do will work just as well.
                          i remember having used #assembler one time. and then popping back to C. but only vagely. okay, i admit that it would be very hard now, since my program uses ncurses. what do you think about using the src code of xev.c and seeing how it determines the modifier keys? [SHIFT, ALY, CTL].

                          how far did you get with the short python scripts?

                          Comment


                            #14
                            xev.c has the following line:

                            */
                            /* $XFree86: xc/programs/xev/xev.c,v 1.14 2004/02/07 04:33:07 dawes Exp $ */
                            XFree86 was replaced by XOrg around 2004 after a GPL incompatible license change made it unpopular with GPL developers. Most of the XFree86 developers moved to the GPL compatible XOrg project. While it might, I wouldn't guarantee that libc6 would be compatible with xev.c, but you can see if it compiles. I notice that it doesn't include "innput.h".

                            I only browsed the evdev.py code, I haven't run it. I was mainly curious as to how it put itself between the hardware and kwin.

                            Right now I am searching why the key click volume control in "Device Inputs" of System Settings doesn't work. One suggestion is to change the keyboard selection.
                            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                            – John F. Kennedy, February 26, 1962.

                            Comment


                              #15
                              well, i cant find xev.c and its makefile. any idea where it is? or how i can get it for my kubuntu 13.04? the code hasnt changed for eons, im sure. ...i gotta look up "Alt Grr" because it's next to my right ctrl key and the four arrow keys.

                              the python code i sent this forum was called linux-clicky-master.zip; it creates a few python files including a list of keybds. my "Penclic" is not among them. besides, it may/maynot work w/ ubuntu. as ive said abv, it hangs and makes a sour clicking with each keypress.

                              the reason the vol control fails when you bring up

                              % systemsettings

                              is that that graphic relies on xset [c] [NN]. the N's for volume. xset has *never* turned on the key-click or volume. i started my domain with a +real ATT system 3 on a 286. i had a second phone line for my 7 or 8 users. then i tried xset under A non ATT. nope. got to be something complex about xset and the "c" switch. i am almost sure to have stared at xset.c ... IIRC, both xev and xset are from the late 1980's.

                              time to look for a C/C++ hacker forum if i cant tell by digging thru the xev src.

                              Comment

                              Working...
                              X