How to subdue the keyboard?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to subdue the keyboard?
# 15  
Old 06-09-2015
@ Wisecracker
Now i'm disappointed *poke*, i thought you want to achieve the dits and dahs with a single key, depending on how long they've been pressed? Smilie
Hence that whole delay check...

The new sounds are great, much better!

@ ChubblerXL
hmm, me get nothing but ?? from space, and quit on q when started with/+out args.
And i dont understand 'a single bit' of your awk code Smilie
Ok ok, i 'get' the if blocks, but neither why nor what they're supposed to achieve...

EDIT:
And from other awk calls, i'd assume KeyPress and KeyRelease to be strings parse by awk, the sub done is according to wether which one is found.
Which doesnt seem to work on my arch install.
# 16  
Old 06-09-2015
The output of xev is like this:

Code:
FocusIn event, serial 20, synthetic NO, window 0xc00001,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 20, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
ReparentNotify event, serial 20, synthetic YES, window 0xc00001,
    event 0xc00001, window 0xc00001, parent 0x70,
    (83,101), override NO

PropertyNotify event, serial 20, synthetic NO, window 0xc00001,
    atom 0xea (_WINDOWSWM_NATIVE_HWND), time 12494276, state PropertyNewValue

KeyPress event, serial 24, synthetic NO, window 0xc00001,
    root 0x70, subw 0x0, time 12496491, (1159,531), root:(1242,632),
    state 0x10, keycode 39 (keysym 0x73, s), same_screen YES,
    XLookupString gives 1 bytes: (73) "s"
    XmbLookupString gives 1 bytes: (73) "s"
    XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0xc00001,
    root 0x70, subw 0x0, time 12496600, (1159,531), root:(1242,632),
    state 0x10, keycode 39 (keysym 0x73, s), same_screen YES,
    XLookupString gives 1 bytes: (73) "s"
    XFilterEvent returns: False

The awk script is looking for KeyPress and KeyRelease events then stripping field 6 from the line that follows which give the event time. If your xev is not producing this type of output the script cannot work.

The above example shows the "s" key being pressed for 109ms.

Attached is the output from xev when I encoded "TEST\n" in morse

Last edited by Chubler_XL; 06-09-2015 at 08:34 PM..
# 17  
Old 06-10-2015
Quote:
Originally Posted by sea
Rudi, mind if apply this to some tui-<command>?
.
.
.
Be my guest...

Quote:
Originally Posted by Chubler_XL
When using xev you should throw in a xset r off
.
.
.
Rats! Was looking for that...
# 18  
Old 06-10-2015
Quote:
Originally Posted by sea
@ Wisecracker
Now i'm disappointed *poke*, i thought you want to achieve the dits and dahs with a single key, depending on how long they've been pressed? Smilie
Hence that whole delay check...

The new sounds are great, much better!
Here you will see what I mean. A semi-auto bug key...

https://www.youtube.com/watch?v=CI1wMVIFDv4

It will use the 'o' and 'p' keys still but you will see what I mean by holding a key to get multiple repeats of a tone without overrun on key release...

Off to work, replies tonight...

Bazza...

EDIT:

A fully auto bug key, includes auto 'dahs'...

https://www.youtube.com/watch?v=LIeiKtM2_eQ

---------- Post updated at 08:01 PM ---------- Previous update was at 08:12 AM ----------

You are going off the beaten track a bit guys...

I am trying to simulate a semi-auto for fully auto bug key.

The manual version as shown in the code works fine in OSX 10.7.5, default bash terminal using the default keyboard setup and behavior.

OSX 10.7.5 does not have stdbuf nor anything related to showkey either.

Remember this is a morse practice oscillator not a visual representation of text to dits and dahs...

As quoted in my OP, I suspect this can't be done...

I have also tried single key action to simulate an ancient telegraph key but it didn't work and was very messy in the attempt...

I will probably leave the code as is, keyboard wise, and work on random character generation with a listsening test and practice against said listening test.

Last edited by wisecracker; 06-10-2015 at 07:19 AM.. Reason: See above...
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Problem getting vertical bar with British keyboard layout on US (physical) keyboard

Hi, I've got a bit of a ridiculous problem and wasn't sure where to post it. I need to use the vertical bar for piping in Bash but, as per the title, am using a UK layout on a US (physical) keyboard which doesn't have a key for it in the place I'd expect. I've tried using xbindkeys and Unicode... (7 Replies)
Discussion started by: crunchgargoyle
7 Replies

2. What is on Your Mind?

Keyboard vs mouse

Which Input device do you use the most ? for me... keyboard ofcourse !! (56 Replies)
Discussion started by: vpraveen84
56 Replies

3. Solaris

Keyboard problem

Hi to everyone I am new at Solaris world so I need little help. I can not put my keyboard to Croatian layout. I tried to edit /etc/default/init and in that file I changed LC_ALL=hr_HR. Also I tried to change my language settings over GUI (input methods and SCIIM) but with no results. Also tried... (11 Replies)
Discussion started by: microbot
11 Replies

4. UNIX for Dummies Questions & Answers

Keyboard keeps locking up

First off, let me start by saying that I am a total rookie when it comes to Unix so I will do my best to explain the situation. BACKGROUND:We are running AIX and using a third party Inventory Management software called Acclaim. My main interface terminal is just a "dummy" terminal hooked up to... (1 Reply)
Discussion started by: sstaszak11
1 Replies

5. Linux

mdk 10.2 and keyboard

Hi all, I'm running a mdk 10.2 cooker on my computer. After and update, i've lost the "alt gr" key. How am i supposed to get it back? I've already googled around a bit, testing solutions provided, but nothing can help.. any other suggestions? Thanx all Jason (3 Replies)
Discussion started by: penguin-friend
3 Replies

6. SCO

Kill from keyboard

I have a cron job that creates my backup tape. However my commands in this job are timing out, therefore "Retrying job retry" is the loop it is hung into. I cannot telnet to the box nor get a login prompt. What is the kill command keystone stroke sequence that will break a cron job? Thanks, (3 Replies)
Discussion started by: jwideman
3 Replies

7. UNIX for Advanced & Expert Users

How can I map Unix keyboard for PC keyboard

A Solaris AXI 440 machine with Solaris 8 version. I have PC users who use an emulation to login to the Solaris server. How can I change the keyboard mapping of the Sun keyboard to fit to the PC keyboard ? Any comment will be appreciated. Thanks (1 Reply)
Discussion started by: simhab
1 Replies
Login or Register to Ask a Question