TMK keyboard firmware collection

Hi,

Thanks once more !

I relation with the questions before:

1) TMK converter doesn't support external LEDs

OK. If I write some code, would you consider including it ?

2) hid_listen

it was a matter of permissions. sudo hid_listen solved the issue.
I wonder why it works with Soarer's firmware. This is why I did not think of this option.
Strange that I have not found this problem in any entry in the forum ...

Regards

i$

--------------------------------
UPDATE
--------------------------------

Done :-)

The code is written and working for the ps2-usb converter.

I have also ported to the terminal-usb converter, but I cannot tested (still :-))
I have used git. Integrating the code should be simple.

In converter/ps2_usb/config.h
Spoiler:
/*
* PHYSICAL LEDs PINOUT
*/
#ifdef PHYSICAL_LEDS_ENABLE

#define LED_INIT_LOOPS 2
#define LED_INIT_DELAY 40

#ifdef CAPS_LOCK_LED_ENABLE
#define CAPS_LOCK_LED_PORT PORTF
#define CAPS_LOCK_LED_PIN PINF
#define CAPS_LOCK_LED_DDR DDRF
#define CAPS_LOCK_LED_BIT 6
#endif

#ifdef NUM_LOCK_LED_ENABLE
#define NUM_LOCK_LED_PORT PORTF
#define NUM_LOCK_LED_PIN PINF
#define NUM_LOCK_LED_DDR DDRF
#define NUM_LOCK_LED_BIT 7
#endif

#ifdef SCROLL_LOCK_LED_ENABLE
#define SCROLL_LOCK_LED_PORT PORTF
#define SCROLL_LOCK_LED_PIN PINF
#define SCROLL_LOCK_LED_DDR DDRF
#define SCROLL_LOCK_LED_BIT 5
#endif

#endif


In converter/ps2_usb/Makefile
Spoiler:
# External LEDs Options
#
PHYSICAL_LEDS_ENABLE = yes # text
CAPS_LOCK_LED_ENABLE = yes # text
NUM_LOCK_LED_ENABLE = yes # text
SCROLL_LOCK_LED_ENABLE = yes # text

In converter/ps2_usb/led.c
void led_set(uint8_t usb_led)
{
uint8_t ps2_led = 0;
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
SCROLL_LOCK_LED_ON; }
else SCROLL_LOCK_LED_OFF;
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
ps2_led |= (1<<PS2_LED_NUM_LOCK);
NUM_LOCK_LED_ON; }
else NUM_LOCK_LED_OFF;
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
ps2_led |= (1<<PS2_LED_CAPS_LOCK);
CAPS_LOCK_LED_ON; }
else CAPS_LOCK_LED_OFF;
ps2_host_set_led(ps2_led);
}


#ifdef PHYSICAL_LEDS_ENABLE

void physical_led_init()
{

uint8_t counter;

for (counter=0; counter<LED_INIT_LOOPS; counter++) {
#ifdef NUM_LOCK_LED_ENABLE
NUM_LOCK_LED_INIT;
NUM_LOCK_LED_ON;
_delay_ms(LED_INIT_DELAY);
NUM_LOCK_LED_OFF;
#endif

#ifdef CAPS_LOCK_LED_ENABLE
CAPS_LOCK_LED_INIT;
CAPS_LOCK_LED_ON;
_delay_ms(LED_INIT_DELAY);
CAPS_LOCK_LED_OFF;
#endif

#ifdef SCROLL_LOCK_LED_ENABLE
SCROLL_LOCK_LED_INIT;
SCROLL_LOCK_LED_ON;
_delay_ms(LED_INIT_DELAY);
SCROLL_LOCK_LED_OFF;
#endif
}

}

#endif


In common/led.h
Spoiler:
#ifdef PHYSICAL_LEDS

/* CAPS_LOCK_LED_ENABLE */
#ifdef CAPS_LOCK_LED_ENABLE

#if !((defined CAPS_LOCK_LED_PORT) && \
(defined CAPS_LOCK_LED_PIN) && \
(defined CAPS_LOCK_LED_DDR) && \
(defined CAPS_LOCK_LED_BIT))
# error "CAPS_LOCK_LED is ENABLE but ports configuration is not defined in config.h"
#endif

#define CAPS_LOCK_LED_INIT (CAPS_LOCK_LED_DDR |= (1<<CAPS_LOCK_LED_BIT))
#define CAPS_LOCK_LED_ON (CAPS_LOCK_LED_PORT |= (1<<CAPS_LOCK_LED_BIT)) // Set the bit to 1
#define CAPS_LOCK_LED_OFF (CAPS_LOCK_LED_PORT &= ~(1<<CAPS_LOCK_LED_BIT)) // Clears the bit to 0

#else

#define CAPS_LOCK_LED_INIT
#define CAPS_LOCK_LED_ON
#define CAPS_LOCK_LED_OFF

#endif
/* CAPS_LOCK_LED_ENABLE */

/* NUM_LOCK_LED_ENABLE */
#ifdef NUM_LOCK_LED_ENABLE
#if !((defined NUM_LOCK_LED_PORT) && \
(defined NUM_LOCK_LED_PIN) && \
(defined NUM_LOCK_LED_DDR) && \
(defined NUM_LOCK_LED_BIT))
# error "NUM_LOCK_LED is ENABLE but ports configuration is not defined in config.h"
#endif

#define NUM_LOCK_LED_INIT (NUM_LOCK_LED_DDR |= (1<<NUM_LOCK_LED_BIT))
#define NUM_LOCK_LED_ON (NUM_LOCK_LED_PORT |= (1<<NUM_LOCK_LED_BIT)) // Set the bit to 1
#define NUM_LOCK_LED_OFF (NUM_LOCK_LED_PORT &= ~(1<<NUM_LOCK_LED_BIT)) // Clears the bit to 0

#else

#define NUM_LOCK_LED_INIT
#define NUM_LOCK_LED_ON
#define NUM_LOCK_LED_OFF

#endif
/* NUM_LOCK_LED_ENABLE */

/* SCROLL_LOCK_LED_ENABLE */
#ifdef SCROLL_LOCK_LED_ENABLE
#if !((defined SCROLL_LOCK_LED_PORT) && \
(defined SCROLL_LOCK_LED_PIN) && \
(defined SCROLL_LOCK_LED_DDR) && \
(defined SCROLL_LOCK_LED_BIT))
# error "SCROLL_LOCK_LED is ENABLE but ports configuration is not defined in config.h"
#endif

#define SCROLL_LOCK_LED_INIT (SCROLL_LOCK_LED_DDR |= (1<<SCROLL_LOCK_LED_BIT))
#define SCROLL_LOCK_LED_ON (SCROLL_LOCK_LED_PORT |= (1<<SCROLL_LOCK_LED_BIT)) // Set the bit to 1
#define SCROLL_LOCK_LED_OFF (SCROLL_LOCK_LED_PORT &= ~(1<<SCROLL_LOCK_LED_BIT)) // Clears the bit to 0

#else

#define SCROLL_LOCK_LED_INIT
#define SCROLL_LOCK_LED_ON
#define SCROLL_LOCK_LED_OFF

#endif
/* SCROLL_LOCK_LED_ENABLE */

void physical_led_init();

#else

#define CAPS_LOCK_LED_ON false;
#define CAPS_LOCK_LED_OFF false;
#define NUM_LOCK_LED_ON false;
#define NUM_LOCK_LED_OFF false;
#define SCROLL_LOCK_LED_ON false;
#define SCROLL_LOCK_LED_OFF false;

#endif

In common/keyboard.c
Spoiler:
void keyboard_init(void)
{
timer_init();
matrix_init();
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
#ifdef SERIAL_MOUSE_ENABLE
serial_mouse_init();
#endif


#ifdef BOOTMAGIC_ENABLE
bootmagic();
#endif

#ifdef BACKLIGHT_ENABLE
backlight_init();
#endif

#ifdef PHYSICAL_LEDS_ENABLE
physical_led_init();
#endif
}

In common.mk
# LEDs
ifdef PHYSICAL_LEDS_ENABLE
OPT_DEFS += -DPHYSICAL_LEDS_ENABLE
endif
ifdef CAPS_LOCK_LED_ENABLE
OPT_DEFS += -DCAPS_LOCK_LED_ENABLE
endif
ifdef NUM_LOCK_LED_ENABLE
OPT_DEFS += -DNUM_LOCK_LED_ENABLE
endif
ifdef SCROLL_LOCK_LED_ENABLE
OPT_DEFS += -DSCROLL_LOCK_LED_ENABLE
endif


Let me know ...


-- EDIT - The code is hidden to ease the reading
Last edited by idollar on 10 Nov 2014, 20:22, edited 1 time in total.
idollar
i$

Unread post02 Nov 2014, 12:37

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
idollar wrote:Hi,

Thanks once more !

I relation with the questions before:

1) TMK converter doesn't support external LEDs

OK. If I write some code, would you consider including it ?

Great.
I'll look into your code, could you make a pull request on github?


2) hid_listen

it was a matter of permissions. sudo hid_listen solved the issue.
I wonder why it works with Soarer's firmware. This is why I did not think of this option.
Strange that I have not found this problem in any entry in the forum ...

You also need the priviledge for Soarers, but if you have a 'udev rule' for it you can avoid using 'sudo'.
I guess you added an entry of 'udev rule' in /etc/udev/rules.d some point in past and forgot it completely :D

You can add this file in rules.d directory for TMK if you want.
File: /etc/udev/rules.d/52-tmk-keyboard.rules
Code: Select all
# tmk keyboard products     https://github.com/tmk/tmk_keyboard
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
hasu
User avatar

Unread post02 Nov 2014, 23:21

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
I will do it.
I just need to figure out how to do it. I am new with git :-)

i$
idollar
i$

Unread post03 Nov 2014, 08:15

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
I just wanted to say that I have not forgotten this.
I just need some time. The weekend will help :-)
idollar
i$

Unread post07 Nov 2014, 14:31

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
idollar wrote:I will do it.
I just need to figure out how to do it. I am new with git :-)

i$

All you need to do is fork, make your changes, then issue the pull request. You can use either the web interface or hub to issue the request.
quantalume

Unread post07 Nov 2014, 18:13

X
quantalume
 
Posts: 420
Joined: 12 Mar 2014, 19:14
Location: Houston, Texas
Main keyboard: IBM Bigfoot
Main mouse: CST trackball
Favorite switch: IBM Model F
Club member: -
 
Hello,

Could it be that I do not have access to the repository ?

This is the new branch in my fork:
Spoiler:
Code: Select all
idollar@x201:~/tmk_keyboard$ git branch
* master
  phys_leds

I have created an ssh key and tested it against github:
Spoiler:
Code: Select all
idollark@x201:~/github/tmk_keyboard$ ssh -vT git@github.com
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Reading configuration data /home/imascara/.ssh/config
....
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.utf8
[b]Hi idollark! You've successfully authenticated, but GitHub does not provide shell access.[/b]
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3312, received 1768 bytes, in 0.2 seconds
Bytes per second: sent 14442.6, received 7709.7
debug1: Exit status 1

And my fork should be pointing to the correct url:
Spoiler:
Code: Select all
idollark@x201:~/tmk_keyboard$ git remote -v
origin   ssh://git@github.com/tmk/tmk_keyboard.git (fetch)
origin   ssh://git@github.com/tmk/tmk_keyboard.git (push)
upstream   ssh://git@github.com/tmk/tmk_keyboard.git (fetch)
upstream   ssh://git@github.com/tmk/tmk_keyboard.git (push)

But I still do not have access to the repository:
Spoiler:
Code: Select all
idollark@x201:~/tmk_keyboard$ git push origin phys_leds
[b]ERROR: Permission to tmk/tmk_keyboard.git denied to idollark.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights[/b]
and the repository exists.

What am I doing wrong ?
Last edited by idollar on 10 Nov 2014, 20:25, edited 1 time in total.
idollar
i$

Unread post08 Nov 2014, 14:08

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
No, you cannot push my repository directly, instead you can send a pull request.
https://help.github.com/articles/creati ... l-request/

But you don't have to lose your time to do this, your previous post already has codes enough for others to reuse. I'll refer to the post in TMK documentation for people interested in adding external LED indicators.
hasu
User avatar

Unread post09 Nov 2014, 05:28

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Hello Hasu,

I would prefer to add the code, after the required review and if agreed, to the mail branch. In this way I will not have to maintain my own local version.

I attach a picture of the result :-)
Demo.jpg


I have tried to create a pull request. The problem is that I cannot do it against my code. My local branch (the one that I have in my computer) is not in the server. I cannot push to it (refer to my previous post). I can pull the code, but I cannot push anything to the repository.

Let me be a little more verbose. We may get there :-) After my reading I came to the following conclusions:

1.- I shall fork the code to my local computer (done)
2.- I shall create a new branch in my local computer (done)
Spoiler:
Code: Select all
git branch phys_leds
git checkout phys_leds

3.- I shall edit the code and test it localy (done)
Spoiler:
I am actually typing with your converter AND THE CAPSLOCK LIGHTS WHEN TYPING THIS :-)

3.- I shall commit the changes to the new local branch in my computer (done)
Spoiler:
Code: Select all
git commit -a -m 'corrected name for PHYSICAL_LEDS_ENABLE (cont)'

4.- Once I am done, I send the code to the github (this is what it does not work)
Spoiler:
Code: Select all
idollark@x201:~/tmk_keyboard$ git push origin phys_leds
[b]ERROR: Permission to tmk/tmk_keyboard.git denied to idollark.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights[/b]
and the repository exists.

I guess that somehow the owner/manager of the code shall give me permissions.

5.- Once the data is in the server I can create a pull request for you to review the code (this is what it does not work)
Spoiler:
I can access the menu in github but only my fork, without my new branch is offered. That's normal, my code is not in the server.
Screenshot1.jpg

6.- The next step would be you review my pull request and add the code to the server if agreed. (tbd)

I guess that somehow the owner of the repository shall allow me to work on it. Am I correct ?

As I said, I have only retrieved (forked) git code before. It is the first time that I use it to propose changes. I know that this is not the topic of this thread, but I guess that it is somehow interesting as other people that may want to propose changes may have the same problems.
I must admit that I also had some problems to find "useful" information about github. There is lot of documentation, but there is not simple explanation on how to do the very basic thing that we (I) am trying to do here.

Cheers
idollar
i$

Unread post09 Nov 2014, 08:24

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
Nice converter setup :D

at step 4 you should push your commits into your own github repository instead of 'tmk'. Problem is that origin means tmk repository, not yours.

To change repository this will work.
Code: Select all
$ git remote set-url origin git@github.com:idollark/tmk_keyboard.git


Then push your commits into your own repository.
Code: Select all
$ git push


EDIT:
or your may need this to push the branch.
Code: Select all
git push origin phys_leds:


Now you can create pull request with github menu probably...
hasu
User avatar

Unread post10 Nov 2014, 16:41

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Thank you ! Finally. At last !
I managed to push my code to the server and create the pull request from it.
I will post a correction to my post above to help anyone that may want to propose any code

Regards
Last edited by idollar on 10 Nov 2014, 20:08, edited 1 time in total.
idollar
i$

Unread post10 Nov 2014, 19:59

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
The following corrects my post above with the information from hasu he hope that it may help someone in the future.

1.- I shall fork the code to my local computer (done)

2.- I shall create a new branch in my local computer (done)
Spoiler:
Code: Select all
git branch phys_leds
git checkout phys_leds

3.- I shall edit the code and test it localy (done)
Spoiler:
I am actually typing with your converter AND THE CAPSLOCK LIGHTS WHEN TYPING THIS :-)

3.- I shall commit the changes to the new local branch in my computer (done)
Spoiler:
Code: Select all
git commit -a -m 'corrected name for PHYSICAL_LEDS_ENABLE (cont)'

4.- Once I am done, I send the code to my repository in the github server (done)
Spoiler:
Code: Select all
idollark@x201:~/tmk_keyboard$ git remote set-url origin git@github.com:idollark/tmk_keyboard.git
idollark@x201:~/tmk_keyboard$ git push origin phys_leds

5.- Once the data is in the server I can create a pull request for you to review the code (done)

6.- The next step would be you review my pull request and add the code to the server if agreed. (tbd)
idollar
i$

Unread post10 Nov 2014, 20:07

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
Thanks, I got your pull request. I'll look into it later.
hasu
User avatar

Unread post11 Nov 2014, 01:17

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Hey, just a few additional notes
idollar wrote:
1.- I shall fork the code to my local computer (done)

2.- I shall create a new branch in my local computer (done)
Code: Select all
git branch phys_leds
git checkout phys_leds


This can be shortened as
Code: Select all
git checkout -b phys_leds

idollar wrote:3.- I shall edit the code and test it localy (done)
Spoiler:
I am actually typing with your converter AND THE CAPSLOCK LIGHTS WHEN TYPING THIS :-)

3.- I shall commit the changes to the new local branch in my computer (done)
Code: Select all
git commit -a -m 'corrected name for PHYSICAL_LEDS_ENABLE (cont)'


I avoid the '-a' option as much as possible, and prefer to first go with
Code: Select all
git add -p
to add the changes one by one, and then use
Code: Select all
git commit
. The '-m' option will encourage you to have very short commit messages, which is also something I try to avoid. In this case, I'd indicate in the longer commit log what issues this wrong name was causing, and what the commit is fixing.
idollar wrote:4.- Once I am done, I send the code to my repository in the github server (done)
Code: Select all
idollark@x201:~/tmk_keyboard$ git remote set-url origin git@github.com:idollark/tmk_keyboard.git
idollark@x201:~/tmk_keyboard$ git push origin phys_leds

You don't have to do everything on the 'origin' remote. In this case, you probably want to have both a remote for your repository so that you can push changes to it, but also a remote in order to sync up with hasu's changes. You can add a remote URL for your repository with
Code: Select all
git remote add idollark git@github.com:idollark/tmk_keyboard.git
and then push to it with
Code: Select all
git push idollark master
. Or you can decide 'origin' points to your repo, and have a remote for hasu's repository.
teuf

Unread post11 Nov 2014, 17:19

X
teuf
 
Posts: 65
Joined: 27 Sep 2011, 10:53
Location: Paris, France
Main keyboard: Noppoo Choc Mini
Favorite switch: MX Brown
Club member: -
 
@teuf - Thank you !
idollar
i$

Unread post20 Nov 2014, 07:29

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
Hi,

I am trying to set a keymap for an Spanish layout. And i am somehow confused.
How may I set the symbol "ñ" ?

I managed to define the following FN0 (~ followed by n) and FN1 (~ followed by N) that would work if I set the keyboard in the OS to "US with dead keys". The documentation somehow week for this feature. I had to reverse engineer the code of some of the distributed keyboard codes.

This is the code that I have added in my keymap_XYZ.c. I then used FN0 and FN1 in the keymaps[][MATRIX_ROWS][MATRIX_COLS] matrix:

Code: Select all
/*
 * Macro definition
 */
enum macro_id {
    ENE,
    ENEMAYUSCULA,
};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
    keyevent_t event = record->event;
    //uint8_t tap_count = record->tap_count;

    switch (id) {
        case ENE:
            return (event.pressed ?
                    MACRO( D(LSHIFT), T(GRV), U(LSHIFT), T(N), END ) :
                    MACRO( END ) );
        case ENEMAYUSCULA:
            return (event.pressed ?
                    MACRO( D(LSHIFT), T(GRV), T(N), U(LSHIFT), END ) :
                    MACRO( END ) );
    }
    return MACRO_NONE;
}


const uint16_t PROGMEM fn_actions[] = {
    [0] = ACTION_MACRO(ENE),
    [1] = ACTION_MACRO(ENEMAYUSCULA),
};


Is there any other way of doing this ?

Many thanks in advance !



@hasu

On a different topic:

Have you find the time to review my 'physical LEDs' code ?
If you are fine with it, I could make a proposal for the remaining converters/keyboards. I would not be able to test the code. I do not have the required hardware to do it.

Cheers

i$k
idollar
i$

Unread post26 Nov 2014, 05:53

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
idollar wrote:Is there any other way of doing this ?

Many thanks in advance !

Nice job!
If you are on Windows you will be able to use Alt code to input, but I'm not sure this has advantage to your method.
http://en.wikipedia.org/wiki/Alt_code

I don't think there is an universal method to input special characters over all OS's and you have to use some specific input method to your OS.



@hasu

On a different topic:

Have you find the time to review my 'physical LEDs' code ?
If you are fine with it, I could make a proposal for the remaining converters/keyboards. I would not be able to test the code. I do not have the required hardware to do it.

Cheers

i$k

Thanks for the pull request.
I saw it and was contemplating tmk LED API. I think led.h should be addedled_init() for initialization as you added(and probably other functions for suspend/resume). And I hesitate to add code of LED control to core(under common/), instead I prefer to place the code under project directory(under converter/ps2_usb). I'll fix the API and merge your code some later.
hasu
User avatar

Unread post27 Nov 2014, 01:10

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
hasu wrote:
idollar wrote:Is there any other way of doing this ?

Many thanks in advance !

Nice job!
If you are on Windows you will be able to use Alt code to input, but I'm not sure this has advantage to your method.
http://en.wikipedia.org/wiki/Alt_code

I don't think there is an universal method to input special characters over all OS's and you have to use some specific input method to your OS.

Thank you for your answer.
@hasu

On a different topic:

Have you find the time to review my 'physical LEDs' code ?
If you are fine with it, I could make a proposal for the remaining converters/keyboards. I would not be able to test the code. I do not have the required hardware to do it.

Cheers

i$k

Thanks for the pull request.
I saw it and was contemplating tmk LED API. I think led.h should be addedled_init() for initialization as you added(and probably other functions for suspend/resume). And I hesitate to add code of LED control to core(under common/), instead I prefer to place the code under project directory(under converter/ps2_usb). I'll fix the API and merge your code some later.

I thought that the LED code would also be interesting for other converters/controllers. This is why I added it into under common/. I could imagine that this feature would also be needed by people using something different than a ps2.

I post the ULR just in case that someone else wants to read the proposal.
https://github.com/tmk/tmk_keyboard/pull/141/files

BTW: I have been using the converter with LEDs for more than two weeks now without any problem.

Cheers

i$k
idollar
i$

Unread post27 Nov 2014, 08:36

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
USB-USB converter was updated and now supports USB Hub, I confirmed HHKB pro2(which has internal hub) works.
https://github.com/tmk/tmk_keyboard/com ... ed0b7b8ed9

This update is first for two years since initial release :D
workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html#p74854

Try it if interested.
hasu
User avatar

Unread post10 Dec 2014, 16:19

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
Ooh, seems nice.

I've been wondering though if an ARM processor would have enough CPU cycles to just bit-bang the USB protocol for the host side (meant to connect a keyboard of course, no hub)... AVR for sure doesn't.
JBert

Unread post10 Dec 2014, 16:27

X
JBert
 
Posts: 1091
Joined: 10 Mar 2011, 23:02
Location: Belgium, land of Liberty Wafles and Freedom Fries
Main keyboard: G80-3K with Clears
Favorite switch: Capacitative BS
Club member: 0049
 
If I wanted to add a hub option to my current keyboard what kind of hardware would I need to get, because I don't think the host shield would work for that purpose?
stormbard

Unread post10 Dec 2014, 21:59

X
stormbard
 
Posts: 21
Joined: 30 Jul 2014, 04:06
Club member: -
 
JBert wrote:Ooh, seems nice.

I've been wondering though if an ARM processor would have enough CPU cycles to just bit-bang the USB protocol for the host side (meant to connect a keyboard of course, no hub)... AVR for sure doesn't.

I could find this projects which host a low speed device like keybaord with AVR. I don't know if there is similar project with ARM.
https://courses.cit.cornell.edu/ee476/F ... index.html
hasu
User avatar

Unread post11 Dec 2014, 05:13

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
stormbard wrote:If I wanted to add a hub option to my current keyboard what kind of hardware would I need to get, because I don't think the host shield would work for that purpose?

Not sure what you want. You want to install USB hub into your keyboard? If so any hub will work for you.
No relation to my firmware there.
hasu
User avatar

Unread post11 Dec 2014, 05:19

User avatar
X
hasu
 
Posts: 354
Joined: 02 Sep 2011, 14:47
Location: Japan
Main keyboard: HHKB
Main mouse: HHKB
Favorite switch: Topre
Club member: -
 
hasu wrote:
stormbard wrote:If I wanted to add a hub option to my current keyboard what kind of hardware would I need to get, because I don't think the host shield would work for that purpose?

Not sure what you want. You want to install USB hub into your keyboard? If so any hub will work for you.
No relation to my firmware there.

I might be overthinking this, but I wanted to add an extra usb port or two and use the same cable that is connecting the keyboard controller to the computer.
stormbard

Unread post11 Dec 2014, 18:11

X
stormbard
 
Posts: 21
Joined: 30 Jul 2014, 04:06
Club member: -
 
idollar wrote:I post the ULR just in case that someone else wants to read the proposal.
https://github.com/tmk/tmk_keyboard/pull/141/files

BTW: I have been using the converter with LEDs for more than two weeks now without any problem.

Cheers

i$k

i tried using the binary created after your changes but i don't see any activity on the F5,F6,F7 outputs of my teensy++ 2.0. i am using an ibm model f terminal 122 key and it doesn't have built-in LED's.
Vizir

Unread post05 Jan 2015, 05:08

X
Vizir
 
Posts: 171
Joined: 20 Oct 2014, 16:55
Location: Tulsa, OK
Main keyboard: IBM Model F 122 / HHKB2
Main mouse: Roccat Nyth
Favorite switch: B/S / Topre
Club member: -
 
Vizir wrote:i tried using the binary created after your changes but i don't see any activity on the F5,F6,F7 outputs of my teensy++ 2.0. i am using an ibm model f terminal 122 key and it doesn't have built-in LED's.

Are you using the PS2 to USB convertor or the terminal convertor ?

The code that I posted implements physical LEDs to the PS2 convertor only. I offered porting it to other keyboards but Hasu wanted to change my code before.



BTW: I am currently restoring a Model F 122 (terminal). I plan to port the changes to this convertor also.
idollar
i$

Unread post05 Jan 2015, 14:44

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
i am using the terminal_usb converter and when i saw the pull request with the changes in the terminal_usb folder i thought you had ported to that too.
Vizir

Unread post05 Jan 2015, 15:12

X
Vizir
 
Posts: 171
Joined: 20 Oct 2014, 16:55
Location: Tulsa, OK
Main keyboard: IBM Model F 122 / HHKB2
Main mouse: Roccat Nyth
Favorite switch: B/S / Topre
Club member: -
 
Vizir wrote:i am using the terminal_usb converter and when i saw the pull request with the changes in the terminal_usb folder i thought you had ported to that too.

This confirms my assumption. Let me read the terminal_usb controller code. You may be lucky and get it done soon :-)
idollar
i$

Unread post05 Jan 2015, 15:47

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
idollar wrote:
Vizir wrote:i am using the terminal_usb converter and when i saw the pull request with the changes in the terminal_usb folder i thought you had ported to that too.

This confirms my assumption. Let me read the terminal_usb controller code. You may be lucky and get it done soon :-)

Vizir, I am lying (I could not remember the complete history). I wrote the code for the terminal converter also but I have not tested it. I will check it with my new (old) keyboard. Which is your keyboard model do you have ?
idollar
i$

Unread post05 Jan 2015, 15:52

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
model f (122 keys)
Vizir

Unread post05 Jan 2015, 15:59

X
Vizir
 
Posts: 171
Joined: 20 Oct 2014, 16:55
Location: Tulsa, OK
Main keyboard: IBM Model F 122 / HHKB2
Main mouse: Roccat Nyth
Favorite switch: B/S / Topre
Club member: -
 
@Vizir

OK. I compiled the code as posted in GIT and you are correct. You are right. It does not work.

There are two typos. One in the Makefile in the config.h file. Actually it caused by the change of name in a "define" that I decided while programming. The associated definitions in the terminal_usb Makefile and the config.h "ifdef" was changed in the ps2_usb converter but not in the terminal_usb converter.

In the Makefile change the entry:
Code: Select all
PHYSICAL_LEDS_ENABLE = yes          # Use to compile with external physical LEDs support
With:
Code: Select all
PHYSICAL_LEDS = yes          # Use to compile with external physical LEDs support


In the file config.h change the entry:
Code: Select all
#ifdef PHYSICAL_LEDS
with
Code: Select all
#ifdef PHYSICAL_LEDS_ENABLE


The above changes make the numberlock key to light the led. Tested.

The capslock did not work on my case as I have an ISO layout. I had to modify the keymap.c also (note that I have changed the commented code from ANSI to ISO:

Instead of:

Code: Select all
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: default
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
     * `---'   `---------------' `---------------' `---------------' `-----------'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|BS | |Ins|Hom|PgU| |NmL|  /|  *|  -|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|   |
     * |-----------------------------------------------------------| `-----------' |-----------|  +|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|Retu|               |  4|  5|  6|   |
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shif|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl|    |Alt |          Space              |Alt |    |Ctrl| |Lef|Dow|Rig| |      0|  .|   |
     * `----'    `---------------------------------------'    `----' `-----------' `---------------'
     */

/*
    KEYMAP(
                     F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,

    PSCR,ESC,   GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,  INS, HOME,PGUP,  NLCK,PSLS,PAST,PMNS,
    SLCK,INT4,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,  DEL, END, PGDN,  P7,  P8,  P9,  PPLS,
    PAUS,INT5,  CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,        UP,         P4,  P5,  P6,  PCMM,
    APP, INT6,  LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,  LEFT,INT2,RGHT,  P1,  P2,  P3,  PENT,
    RGUI,LGUI,  LCTL,     LALT,               SPC,                          RALT,     RCTL,       DOWN,       NO,  P0,  PDOT,NO
    ),
*/
    // pseudo ANSI
    KEYMAP(
                     F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,

    PSCR,ESC,   ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NO,  BSPC,  INS, HOME,PGUP,  NLCK,PSLS,PAST,PMNS,
    SLCK,INT4,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     NO,    DEL, END, PGDN,  P7,  P8,  P9,  PPLS,
    PAUS,INT5,  LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     BSLS,ENT,        UP,         P4,  P5,  P6,  PCMM,
    APP, INT6,  LSFT,LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     NO,  RSFT,  LEFT,INT2,RGHT,  P1,  P2,  P3,  PENT,
    RGUI,LGUI,  LCTL,     LALT,               SPC,                          LGUI,     GRV,        DOWN,       NO,  P0,  PDOT,NO
    ),
};

I used:
Code: Select all
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* 0: default
     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
     * `---'   `---------------' `---------------' `---------------' `-----------'
     * ,-----------------------------------------------------------. ,-----------. ,---------------.
     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|BS | |Ins|Hom|PgU| |NmL|  /|  *|  -|
     * |-----------------------------------------------------------| |-----------| |---------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|   |
     * |-----------------------------------------------------------| `-----------' |-----------|  +|
     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|Retu|               |  4|  5|  6|   |
     * |-----------------------------------------------------------|     ,---.     |---------------|
     * |Shif|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
     * |Ctrl|    |Alt |          Space              |Alt |    |Ctrl| |Lef|Dow|Rig| |      0|  .|   |
     * `----'    `---------------------------------------'    `----' `-----------' `---------------'
     */

    KEYMAP(
                     F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,

    PSCR,ESC,   GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,  INS, HOME,PGUP,  NLCK,PSLS,PAST,PMNS,
    SLCK,INT4,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,  DEL, END, PGDN,  P7,  P8,  P9,  PPLS,
    PAUS,INT5,  CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,        UP,         P4,  P5,  P6,  PCMM,
    APP, INT6,  LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,  LEFT,INT2,RGHT,  P1,  P2,  P3,  PENT,
    RGUI,LGUI,  LCTL,     LALT,               SPC,                          RALT,     RCTL,       DOWN,       NO,  P0,  PDOT,NO
    ),
/*
    // pseudo ANSI
    KEYMAP(
                     F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,

    PSCR,ESC,   ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NO,  BSPC,  INS, HOME,PGUP,  NLCK,PSLS,PAST,PMNS,
    SLCK,INT4,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     NO,    DEL, END, PGDN,  P7,  P8,  P9,  PPLS,
    PAUS,INT5,  LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     BSLS,ENT,        UP,         P4,  P5,  P6,  PCMM,
    APP, INT6,  LSFT,LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     NO,  RSFT,  LEFT,INT2,RGHT,  P1,  P2,  P3,  PENT,
    RGUI,LGUI,  LCTL,     LALT,               SPC,                          LGUI,     GRV,        DOWN,       NO,  P0,  PDOT,NO
    ),
*/
};


Tested.

I have attached my "terminal_usb" directory to ease the understanding of the description above. You can also use these new files instead of the ones in GITHUB. I need to check how to update my code proposal in GITHUB (new challenge :-))
EDIT: I think I managed to update github also

The only thing that is left is to check the "a" key of my keyboard. It seems that is not working fine after the bold-mod ;)

Cheers

i$
Attachments
terminal_usb.tar.gz
(7.52 KiB) Downloaded 35 times
Last edited by idollar on 06 Jan 2015, 22:03, edited 1 time in total.
idollar
i$

Unread post06 Jan 2015, 21:39

X
idollar
i$
 
Posts: 1312
Joined: 24 Oct 2014, 15:57
Location: Germany (Frankfurt area)
Main keyboard: IBM F or M
Favorite switch: BS
Club member: 0091
 
PreviousNext

Who is online

Users browsing this forum: jaared, Wolf123rt and 36 guests