Author Topic: TMK keyboard firmware  (Read 642808 times)

0 Members and 1 Guest are viewing this topic.

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1650 on: Sat, 08 October 2016, 10:04:38 »
The keycodes KC_COPY and KC_PASTE doesn't seem to work for me, anyone got an idea what might be the issue?

I'm reading tmk_keyboard/tmk_core/common/keycode.h and KC_COPY is, I think, 0x7C. In this chart, Microsoft seem to say that code is for F13. It looks like Windows won't interpret those codes the way you want.

[EDIT]

I'm sitting here looking at that page in one of the tabs but when I copy/paste the address it botches. I hope you can make it work.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731

https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx
« Last Edit: Sat, 08 October 2016, 10:11:46 by Tactile »

Offline Eszett

  • Posts: 536
  • Supporting the communities Geekhack & Deskthority
Re: TMK keyboard firmware
« Reply #1651 on: Sat, 08 October 2016, 10:21:24 »
Hi Tactile. Yes, I can follow your argument. Do you think it is a shortcoming in TMK?
« Last Edit: Sat, 08 October 2016, 10:35:05 by Eszett »

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1652 on: Sat, 08 October 2016, 10:30:18 »
Hi Tactile. Yes, I can follow your argument. Do you think it is a bug in TMK?

I don't think in Windows there is a single key code for copy or paste. I think there are only CTL-C & CTL-V. The problem isn't in TMK but instead in the way Windows interprets keycodes. I think the "COPY" & "PASTE" in TMK are holdovers from UNIX keyboards & there just isn't an equivalent in Windows.

Offline Eszett

  • Posts: 536
  • Supporting the communities Geekhack & Deskthority
Re: TMK keyboard firmware
« Reply #1653 on: Sat, 08 October 2016, 10:34:38 »
@Tactile, yes, understood. So I have to put up a macro in TMK for "Ctrl-v" and "Ctrl-c".

Offline Tactile

  • Posts: 1370
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1654 on: Sat, 08 October 2016, 10:38:04 »
@Tactile, yes, understood. So I have to put up a macro in TMK for "Ctrl-v" and "Ctrl-c".

I think that's the only way to do it.... but I've been wrong before  :D

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1655 on: Sat, 08 October 2016, 14:02:48 »
The keycodes KC_COPY and KC_PASTE doesn't seem to work for me, anyone got an idea what might be the issue?

I'm reading tmk_keyboard/tmk_core/common/keycode.h and KC_COPY is, I think, 0x7C. In this chart, Microsoft seem to say that code is for F13. It looks like Windows won't interpret those codes the way you want.

[EDIT]

I'm sitting here looking at that page in one of the tabs but when I copy/paste the address it botches. I hope you can make it work.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731

https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx

It is not codes keyboard sends to host, you can refer to these.
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1656 on: Sat, 08 October 2016, 14:04:11 »
Hi Tactile. Yes, I can follow your argument. Do you think it is a shortcoming in TMK?

No, it is your OS's probably. Try Solaris or kindof Unix it will recognize the keys.

Offline Eszett

  • Posts: 536
  • Supporting the communities Geekhack & Deskthority
Re: TMK keyboard firmware
« Reply #1657 on: Sat, 08 October 2016, 15:23:12 »
Alright hasu. I solved this now without a clumsy macro. I added to the keymap (keymap.c) "LCTL(KC_V)" for pasting. I'm not sure if this is a QMK-only feature, or also works in TMK. But it's the most convenient way and executes quickly without delay. :thumb:
« Last Edit: Sat, 08 October 2016, 15:27:19 by Eszett »

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1658 on: Sat, 08 October 2016, 16:33:31 »
Alright hasu. I solved this now without a clumsy macro. I added to the keymap (keymap.c) "LCTL(KC_V)" for pasting. I'm not sure if this is a QMK-only feature, or also works in TMK. But it's the most convenient way and executes quickly without delay. :thumb:

I'm not sure if you already know that QMK has great community on github or reddit. You can ask your question there because you are using QMK.

Offline Eszett

  • Posts: 536
  • Supporting the communities Geekhack & Deskthority
Re: TMK keyboard firmware
« Reply #1659 on: Sat, 08 October 2016, 17:07:02 »
Ok, sorry, I wrote in the wrong thread then.

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1660 on: Tue, 18 October 2016, 19:29:39 »
A noob question. What's the difference between "infinity" and "infinity_chibios"?

Also, when I compile infinity, it shows the following error:
../../tmk_core/common/mbed/xprintf.cpp:1:19: fatal error: cstdarg: No such file or directory
Am I missing some dependency here?

Thanks!
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1661 on: Tue, 18 October 2016, 19:39:05 »
hmm it smells like a toolchain problem.

You can use this method to build if you are not on Linux.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1662 on: Tue, 18 October 2016, 20:11:00 »
hmm it smells like a toolchain problem.

You can use this method to build if you are not on Linux.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox
Thanks for the reply. I am on Linux though. Running Ubuntu 14.04 and my Alps64 compiles without a problem.

By the way, what's the difference between "infinity" and "infinity_chibios"?
« Last Edit: Tue, 18 October 2016, 20:13:24 by ctm »
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1663 on: Tue, 18 October 2016, 20:19:34 »
Difference is mbed.org based vs chibios based.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1664 on: Tue, 18 October 2016, 20:38:01 »
hmm it smells like a toolchain problem.

You can use this method to build if you are not on Linux.
https://github.com/tmk/tmk_keyboard/wiki/Build-firmware-on-VirtualBox
Thanks for the reply. I am on Linux though. Running Ubuntu 14.04 and my Alps64 compiles without a problem.

See these. Probably you will have to install specific version from PPA on 14.04. Or update your ubuntu to 16.04 it seems to work without problem.
https://github.com/tmk/tmk_keyboard/issues/212#issuecomment-100422816
https://github.com/tmk/tmk_keyboard/wiki/mbed-cortex-porting


Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1665 on: Tue, 18 October 2016, 21:20:28 »
A noob question. What's the difference between "infinity" and "infinity_chibios"?

Also, when I compile infinity, it shows the following error:
../../tmk_core/common/mbed/xprintf.cpp:1:19: fatal error: cstdarg: No such file or directory
Am I missing some dependency here?

Thanks!
I find out the problem. It turns out arm-none-eabi-gcc that I got from Ubuntu PPA was 4.8. I added team-gcc-arm-embedded/ppa and installed 5.4.1 and now it works!
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1666 on: Tue, 18 October 2016, 21:41:16 »
Hmm... now my Infinity firmware compiles, but when I flash it (sudo make program), the keyboard behaves very strangely. The debug LED keeps flashing. When pressing a key, sometimes it does nothing, sometimes it splits out a random key. Any suggestions?
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1667 on: Wed, 19 October 2016, 03:05:10 »
As far as i know Infinity has tree diffrent versions; prototype, without led and with led.
If you have prototype define INFINITY_PROTOTYPE in config.h, INFINITY_LED for 'with led'.

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1668 on: Wed, 19 October 2016, 07:28:33 »
As far as i know Infinity has tree diffrent versions; prototype, without led and with led.
If you have prototype define INFINITY_PROTOTYPE in config.h, INFINITY_LED for 'with led'.
Thanks a lot! That's exactly what I was missing.
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1669 on: Fri, 21 October 2016, 11:47:53 »
Hasu, thank you again for TMK firmware. I hope this is the right "spot" for this question. If not, please let me know and I'll post again in a diff part of the forum.

So, this is my first build, and I wanted to try a simple hand wire. "Simple".

In the pic below, I have the "Core". buttons working on the numpad. The upper right grid. All of the red wires.

However, I CANNOT figure out how to configure(or did I wire it wrong?) the "L" shaped 5 keys on the left and bottom. Green/Black

I have posted all the code I am using and none of the keys on the leftmost column or bottom most row work.

Is this wired right?
Am I using the config code properly? All of the NUMBERS and Function keys work, just not any Letters.

150874-0
150876-1



« Last Edit: Fri, 21 October 2016, 13:53:43 by kalmlikabohm »

Offline ctm

  • Posts: 424
  • Location: Seattle, WA
  • Hello, world!
Re: TMK keyboard firmware
« Reply #1670 on: Sat, 22 October 2016, 11:18:04 »
Does infinity_chibios currently support Infinity 1.1 (with LEDs)?
TMK Alps64 w/ Matias Quiet Switches in KBP V60 case.
Infinity60 with SKCM Orange Switches w/ TMK.
CM Storm QRF w/ Frosty Flake controller, Cherry MX Blue Switches and TMK firmware.


Coming:
Ellipse Model F F62.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1671 on: Sat, 22 October 2016, 20:57:41 »
Does infinity_chibios currently support Infinity 1.1 (with LEDs)?

no.

Offline Lude

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1672 on: Thu, 27 October 2016, 09:07:55 »
Hi,

I use tmk converter on an italian IBM Terminal 122 keys keyboard with a pro micro clone.
I would to know if there's a keycode to leave default key value, something like "KC_DEFAULT"
I'm asking 'cause I haved a little problem with KC_BSLASH and KC_NONUS_BSLASH. They print "" instead of "\"
I've used KC_GRAVE and I fixed it!

I've problem with bootloader mode using 0x7777 stuff
I know that something happens 'cause I hear usb disconnected device under win 7, but serial port is not recognized.
I use bootloader burned from arduino ide.
Any hint?

Thank you,
Lude

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1673 on: Thu, 27 October 2016, 11:02:04 »
Hi,

I use tmk converter on an italian IBM Terminal 122 keys keyboard with a pro micro clone.
I would to know if there's a keycode to leave default key value, something like "KC_DEFAULT"
I'm asking 'cause I haved a little problem with KC_BSLASH and KC_NONUS_BSLASH. They print "" instead of "\"
I've used KC_GRAVE and I fixed it!

I've problem with bootloader mode using 0x7777 stuff
I know that something happens 'cause I hear usb disconnected device under win 7, but serial port is not recognized.
I use bootloader burned from arduino ide.
Any hint?

Thank you,
Lude

what's your os and layout?

EDIT: And are you talking about key between left shift and z?

Offline Lude

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1674 on: Thu, 27 October 2016, 13:18:29 »
what's your os and layout?

EDIT: And are you talking about key between left shift and z?

Hi,

I've Win7 sp1 64bit and I use a standard italian layout.
I'm talking about key before 1, just below escape key in my standard keyboard.
If you refer to tmk layout I use modified default on terminal_usb:

    KEYMAP(
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,
                MYCM, WHOM, WBAK, WFWD, F17, F18, F19, F20, FN4, PAUSE, SCROLLLOCK, PSCR,

    ESC,LGUI,   GRAVE, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NO,  BSPC,  INS, HOME,PGUP,  CALC,NLCK,PSLS,PAST,
    MPLY,MUTE,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     NO,    DEL, END, PGDN,  P7,  P8,  P9,  PMNS,
    VOLU,VOLD,  CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     BSLS,ENT,        UP,         P4,  P5,  P6,  PPLS,
    FN2,FN3,  LSFT,NONUS_BSLASH,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     NO,  RSFT,  LEFT,DOWN,RGHT,  P1,  P2,  P3,  PENT,
    FN0,FN1,  LCTL,     LALT,               SPC,                          RALT,     RCTL,        DOWN,       NO,  P0,  PDOT,NO
    ),


EDIT:
maybe I'm a bit confused regarding KC_BSLASH and KC_NONUS_BSLASH.
Probabily KC_BSLASH  gives me an "".
KC_NONUS_BSLASH gives me a "<". As you can see I use it on keymap, just before Z key

« Last Edit: Thu, 27 October 2016, 13:34:53 by Lude »

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1675 on: Thu, 27 October 2016, 13:45:15 »
what's your os and layout?

EDIT: And are you talking about key between left shift and z?

Hi,

I've Win7 sp1 64bit and I use a standard italian layout.
I'm talking about key before 1, just below escape key in my standard keyboard.
If you refer to tmk layout I use modified default on terminal_usb:

    KEYMAP(
                     F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,
                MYCM, WHOM, WBAK, WFWD, F17, F18, F19, F20, FN4, PAUSE, SCROLLLOCK, PSCR,

    ESC,LGUI,   GRAVE, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NO,  BSPC,  INS, HOME,PGUP,  CALC,NLCK,PSLS,PAST,
    MPLY,MUTE,  TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     NO,    DEL, END, PGDN,  P7,  P8,  P9,  PMNS,
    VOLU,VOLD,  CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     BSLS,ENT,        UP,         P4,  P5,  P6,  PPLS,
    FN2,FN3,  LSFT,NONUS_BSLASH,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     NO,  RSFT,  LEFT,DOWN,RGHT,  P1,  P2,  P3,  PENT,
    FN0,FN1,  LCTL,     LALT,               SPC,                          RALT,     RCTL,        DOWN,       NO,  P0,  PDOT,NO
    ),




Ah, OK. It is just common woe of non-US layout(qwerty) users, computer is completely US centric, not Italy nor Japan unfortunately :D
USB spec uses key naming of US layout, so you have to think in that way even if your keyboard is italian. For example, in France they send keycode of 'q' to computer to get 'a' with their azerty keyboard, I guess.

Offline a-c

  • Posts: 196
  • Location: USA
Tiny TMK
« Reply #1676 on: Wed, 02 November 2016, 14:51:24 »

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1677 on: Wed, 02 November 2016, 23:52:27 »
looks nice :thumb:

Offline ac2ev

  • Posts: 32
Re: TMK keyboard firmware
« Reply #1678 on: Sun, 13 November 2016, 16:01:21 »
I'm starting to program TMK for my keyboard. I've got the matrix all mapped out and I'm now modifying the keymap and I have a "issue". The keyboard I'm using is non-standard in the fact that the typical key pairs such at '7&' ':;' aren't all the same.

1st key is normal, 2nd key is with Shift Modifier
2  "
6 &
7 '
8 (
9 )
- =
~ ^
` @
The list goes on. How do I program these? Do I program the first layer as normal the correct option and then rather then TRNS for the second layer I subsitute the actual key?

layer 0
1 2 3 4 5 6 7

layer 1
TRNS " TRNS TRNS TRNS & '

Lastly, how do I program a mechanical latching Shift Lock? My keyboard has both a latching and non-latching shift key.

It also has a latching RPT key which I'm thinking I could use for something else just not sure what.

Pictures over in this post:
https://geekhack.org/index.php?topic=85666.0



Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1679 on: Sun, 13 November 2016, 20:16:34 »
Read and find proper action for your need in this doc or code. If you can't find you will have to write code for your own action.
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action_code.h

EDIT: Defining Shift layer in keybard firmware is generally difficult or not good idea at least, in some situation you will have subtle problem. Instead, changing keyboard layout on your computer is good and legitimate idea.

If you want to use the "Shift Lock" key as shift lock assign normal shift keycode, or  see this if locking capslock is what you want.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#mechanical-lock-switch-support
« Last Edit: Sun, 13 November 2016, 20:21:30 by hasu »

Offline ac2ev

  • Posts: 32
Re: TMK keyboard firmware
« Reply #1680 on: Mon, 14 November 2016, 06:45:14 »
Those are those I was reading. Looks like I might be digging into the code or using something like SharpKeys to re-assign keys. Since I'm a touch typist I may just choose to ignore the legends and program it as a normal layout.

Thank you.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1681 on: Fri, 18 November 2016, 12:03:31 »
Yet again i have to request your help. Ive soldered in my diodes the wrong way. Now ive read that it is possible to reverse them in software but how? Can anybody tell me?

Look at the matrix.c from the phantom keyboard for an example of wiring with the diodes in the opposite direction to the GH60. https://github.com/tmk/tmk_keyboard/blob/master/keyboard/phantom/matrix.c
So i would need to switch all rows for cols and do the same in the matrix? If so id rather desolder the switches and turn the diode

What happened to this file?
I _might_ have done something similar and am still debugging. Having the option to reverse the scan/diodes in code would be a HUGE help.


Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1682 on: Fri, 18 November 2016, 13:00:18 »
Yet again i have to request your help. Ive soldered in my diodes the wrong way. Now ive read that it is possible to reverse them in software but how? Can anybody tell me?

Look at the matrix.c from the phantom keyboard for an example of wiring with the diodes in the opposite direction to the GH60. https://github.com/tmk/tmk_keyboard/blob/master/keyboard/phantom/matrix.c
So i would need to switch all rows for cols and do the same in the matrix? If so id rather desolder the switches and turn the diode

What happened to this file?
I _might_ have done something similar and am still debugging. Having the option to reverse the scan/diodes in code would be a HUGE help.

Hasu did some housekeeping, they are now in the orphan folder. https://github.com/tmk/tmk_keyboard/tree/master/orphan/phantom

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1683 on: Fri, 18 November 2016, 13:03:21 »
Yet again i have to request your help. Ive soldered in my diodes the wrong way. Now ive read that it is possible to reverse them in software but how? Can anybody tell me?

Look at the matrix.c from the phantom keyboard for an example of wiring with the diodes in the opposite direction to the GH60. https://github.com/tmk/tmk_keyboard/blob/master/keyboard/phantom/matrix.c
So i would need to switch all rows for cols and do the same in the matrix? If so id rather desolder the switches and turn the diode

What happened to this file?
I _might_ have done something similar and am still debugging. Having the option to reverse the scan/diodes in code would be a HUGE help.

Hasu did some housekeeping, they are now in the orphan folder. https://github.com/tmk/tmk_keyboard/tree/master/orphan/phantom

Awesome!

So "reversing" the direction really isn't a programming field of variable, but just redefining the whole matrix? Is this correct? I have a 5 x 7 keyboard, but the diodes run vertically.

Much like Transposing a Matrix? https://en.wikipedia.org/wiki/Transpose
« Last Edit: Fri, 18 November 2016, 13:21:41 by kalmlikabohm »

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1684 on: Fri, 18 November 2016, 13:23:46 »
Yet again i have to request your help. Ive soldered in my diodes the wrong way. Now ive read that it is possible to reverse them in software but how? Can anybody tell me?

Look at the matrix.c from the phantom keyboard for an example of wiring with the diodes in the opposite direction to the GH60. https://github.com/tmk/tmk_keyboard/blob/master/keyboard/phantom/matrix.c
So i would need to switch all rows for cols and do the same in the matrix? If so id rather desolder the switches and turn the diode

What happened to this file?
I _might_ have done something similar and am still debugging. Having the option to reverse the scan/diodes in code would be a HUGE help.

Hasu did some housekeeping, they are now in the orphan folder. https://github.com/tmk/tmk_keyboard/tree/master/orphan/phantom

Awesome!

So "reversing" the direction really isn't a programming field of variable, but just redlining the whole matrix? Is this correct? I have a 5 x 7 keyboard, but the diodes run vertically.

Yes, you are either strobing the rows and reading the columns or strobing the columns and reading the rows. The Phantom strobes the columns and reads the rows. You will have to post a picture of your wiring, you can do it either way with the diodes connected in rows or columns.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1685 on: Fri, 18 November 2016, 13:32:47 »
Yet again i have to request your help. Ive soldered in my diodes the wrong way. Now ive read that it is possible to reverse them in software but how? Can anybody tell me?

Look at the matrix.c from the phantom keyboard for an example of wiring with the diodes in the opposite direction to the GH60. https://github.com/tmk/tmk_keyboard/blob/master/keyboard/phantom/matrix.c
So i would need to switch all rows for cols and do the same in the matrix? If so id rather desolder the switches and turn the diode

What happened to this file?
I _might_ have done something similar and am still debugging. Having the option to reverse the scan/diodes in code would be a HUGE help.

Hasu did some housekeeping, they are now in the orphan folder. https://github.com/tmk/tmk_keyboard/tree/master/orphan/phantom

Awesome!

So "reversing" the direction really isn't a programming field of variable, but just redlining the whole matrix? Is this correct? I have a 5 x 7 keyboard, but the diodes run vertically.

Yes, you are either strobing the rows and reading the columns or strobing the columns and reading the rows. The Phantom strobes the columns and reads the rows. You will have to post a picture of your wiring, you can do it either way with the diodes connected in rows or columns.

Awesome! Ok, I will try to transpose the code then. I have done a hand wire with a numpad tester and it went OK. This is proving a little more difficult.

Do the pin connections have to be contiguous? I skipped many pins because I have yet to add the other half of the Dactyl. I am forgoing the Multiplex chip and just going to have 12 wires bridging from the left to the right.

Thanks for the help A-C.

Offline a-c

  • Posts: 196
  • Location: USA
Re: TMK keyboard firmware
« Reply #1686 on: Fri, 18 November 2016, 13:41:44 »
Awesome! Ok, I will try to transpose the code then. I have done a hand wire with a numpad tester and it went OK. This is proving a little more difficult.

Do the pin connections have to be contiguous? I skipped many pins because I have yet to add the other half of the Dactyl. I am forgoing the Multiplex chip and just going to have 12 wires bridging from the left to the right.

Thanks for the help A-C.

Your matrix is wired like the Phantom. What order you use the pins does not matter. On Teensy 2.0 all the pins can do the digital i/o needed for a scanning matrix.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1687 on: Fri, 18 November 2016, 13:46:06 »
Awesome! Ok, I will try to transpose the code then. I have done a hand wire with a numpad tester and it went OK. This is proving a little more difficult.

Do the pin connections have to be contiguous? I skipped many pins because I have yet to add the other half of the Dactyl. I am forgoing the Multiplex chip and just going to have 12 wires bridging from the left to the right.

Thanks for the help A-C.

Your matrix is wired like the Phantom. What order you use the pins does not matter. On Teensy 2.0 all the pins can do the digital i/o needed for a scanning matrix.
Hrmm ok. So I am confused why I get NOTHING when I plug it in an load up the firmware. It acts as if the keyboard is not even connected.

Should I un-comment "MATRIX_HAS_GHOST" in Config.h?

I really don't care if I have to define my keymap a bit odd to get this working.

PS: I loaded up the BLINKY test for Teensy 2.0 and it works OK, so the chip seems to be working just fine.

Code: [Select]
// Column 0 is Right Most Column on RIGHT Dactly
// Row 0 is BOTTOM most Row on RIGHT Dactyl

// LEFT... N ... N-1....  .... 1  ... 0 ... RIGHT
// COL:  0  1  2  3  4  5  6
// PIN: F0 F1 F4 F5 F6 F7 B6

// ROW:  0  1  2  3  4
// PIN: D1 D0 B7 B3 B2
« Last Edit: Fri, 18 November 2016, 13:53:25 by kalmlikabohm »

Offline jigg4

  • Posts: 11
Re: TMK keyboard firmware
« Reply #1688 on: Wed, 23 November 2016, 00:07:43 »
I finally managed to flash my GH60 rev C (my first custom built). I had some troubles with my iso keymap at first, because I only had 63 keys declared. Took me a while to realize what's wrong and that the default keymap has 65 keys and especially 5 keys on the right modifiers side.

Now the only thing missing is the key near the left shift  "<>". What do I have to put in my keymap to receive this key. It is currently mapped as backslash and I get a "#" when I press it. The language of my PC is German.


Offline wooger

  • Posts: 2
Re: TMK keyboard firmware
« Reply #1689 on: Wed, 23 November 2016, 10:59:00 »
I got my USB-USB converter from hasu a couple of weeks ago, and it's already working pretty great with a modified Space-Fn layout. So far I just modified a Space-Fn preset someone linked to on the online keymap builder and used dfu-programmer to flash it.

At the moment I'm still using Autohotkey to map a few shortcuts, but hope to incorporate these into the TMK firmware with some work.
Ctrl-Q => Alt-F4 (close window)
Ctrl-Space => Windows Key
Ctrl-Tab => Alt-Tab

Noob questions:
#1 - Is it possible to map these key shortcuts in TMK firmware?

#2 - How would I go about doing this? I understand I need to modify a bit of C code grabbed from github, but it's not clear which files I change. Is there a tutorial or some example of similar shortcuts which I can copy?

#3 - One possible problem with my current setup: I'm pretty sure the Ctrl key has been sticking on a few occasions for me when using the converter. This has happened with different keyboards, so it's not the hardware, and has been fixed by tapping Ctrl a few times. Anything to check?

It's probably a bug with the keymap I'm running, but as all I've done is swap a few layer-0 keys around, not sure why.

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1690 on: Thu, 24 November 2016, 07:15:48 »
Hasu, could TMK be used to convert the Displaywriter keyboard protocol? Here's a relevant page from Displaywriter manual:
More

Relevant pinouts are shown further down in the manual.

I don't know if frequency of data clock should be determined from the actual Displaywriter system, but other than that it seems pretty straightforward.

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1691 on: Thu, 24 November 2016, 09:01:18 »
I got my USB-USB converter from hasu a couple of weeks ago, and it's already working pretty great with a modified Space-Fn layout. So far I just modified a Space-Fn preset someone linked to on the online keymap builder and used dfu-programmer to flash it.

At the moment I'm still using Autohotkey to map a few shortcuts, but hope to incorporate these into the TMK firmware with some work.
Ctrl-Q => Alt-F4 (close window)
Ctrl-Space => Windows Key
Ctrl-Tab => Alt-Tab

Noob questions:
#1 - Is it possible to map these key shortcuts in TMK firmware?

#2 - How would I go about doing this? I understand I need to modify a bit of C code grabbed from github, but it's not clear which files I change. Is there a tutorial or some example of similar shortcuts which I can copy?

#3 - One possible problem with my current setup: I'm pretty sure the Ctrl key has been sticking on a few occasions for me when using the converter. This has happened with different keyboards, so it's not the hardware, and has been fixed by tapping Ctrl a few times. Anything to check?

It's probably a bug with the keymap I'm running, but as all I've done is swap a few layer-0 keys around, not sure why.

If the TMK converter is anything like the normal TMK, yes.

1. You will probably need a Macro.
2. See an attempt below. Hopefully this will get you started.

File: Keymap_Poker.c (Or whatever keymap file you want)
The following marcos will produce some gibberish, but at least you know its working!
Code: [Select]

/ enum macro_id {
//    YATTA1,
//    YATTA2,
//    YATTA3,
//    YATTA4,
//   };


onst action_t PROGMEM fn_actions[] = {
    /* Poker Layout */
    // [1] = ACTION_MACRO(YATTA1),  // to Fn overlay
    // [2] = ACTION_MACRO(YATTA2),  // to Fn overlay
.....

// const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
// {
  //  switch (id) {
  //  case YATTA1:
  //     return (record->event.pressed ?
  //             MACRO( T(SLSH), D(LSHIFT), T(9), U(LSHIFT), T(V), END ) :
  //             MACRO_NONE );
  // case YATTA2:
  //     return (record->event.pressed ?
  //             MACRO( T(SLSH), D(LSHIFT), T(9), U(LSHIFT), T(V), END ) :
  //             MACRO_NONE );

.....

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1692 on: Thu, 24 November 2016, 12:25:17 »
Hasu, could TMK be used to convert the Displaywriter keyboard protocol? Here's a relevant page from Displaywriter manual:
More
Show Image

Relevant pinouts are shown further down in the manual.

I don't know if frequency of data clock should be determined from the actual Displaywriter system, but other than that it seems pretty straightforward.

I think so. Nice find, bitsavers is always great resources for old computing.
It doesn't seem to have break codes on most of keys unfortunately, it may be problem when used on modern computers.

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1693 on: Thu, 24 November 2016, 12:34:19 »
I got my USB-USB converter from hasu a couple of weeks ago, and it's already working pretty great with a modified Space-Fn layout. So far I just modified a Space-Fn preset someone linked to on the online keymap builder and used dfu-programmer to flash it.

At the moment I'm still using Autohotkey to map a few shortcuts, but hope to incorporate these into the TMK firmware with some work.
Ctrl-Q => Alt-F4 (close window)
Ctrl-Space => Windows Key
Ctrl-Tab => Alt-Tab

Noob questions:
#1 - Is it possible to map these key shortcuts in TMK firmware?

#2 - How would I go about doing this? I understand I need to modify a bit of C code grabbed from github, but it's not clear which files I change. Is there a tutorial or some example of similar shortcuts which I can copy?

#3 - One possible problem with my current setup: I'm pretty sure the Ctrl key has been sticking on a few occasions for me when using the converter. This has happened with different keyboards, so it's not the hardware, and has been fixed by tapping Ctrl a few times. Anything to check?

It's probably a bug with the keymap I'm running, but as all I've done is swap a few layer-0 keys around, not sure why.

It is kindof possible but not simple. You'll need to use ACTION_LAYER_MODS(1, MOD_LCTL) on the control key for example, to define the  'shortcuts' on Layer 2.
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers

The shortcuts need to be defined as MACRO or FUNCTION. Documentation is sparse, find and check keymap files in github as sample.
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#23-macro-action
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#24-function-action

As for Ctrl stuck see this entry.
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1694 on: Thu, 24 November 2016, 15:13:10 »
I think so. Nice find, bitsavers is always great resources for old computing.
It doesn't seem to have break codes on most of keys unfortunately, it may be problem when used on modern computers.

Is there any other board/protocol that doesn't have break codes but has been converted? Any info on general approach on how to handle such situations?

But anyways, manual says the following:
Quote
The data is converted to an eight bit data byte by the keyboard adapter in the system electronics. The data byte contains a seven bit code indicating the key position. The eighth bit in the data byte indicates a key depression and key release for make/break keys or repeat mode for typamatic keys.

If I'm understanding it correctly, if a bit is set (or alternatively, not set) it will be a break code. Or did I completely misunderstand this?

Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1695 on: Thu, 24 November 2016, 16:28:50 »
You could relay make and pseudo break code to PC at same time when receiving from keyboard.

See 5-9 some modifiers only send break code, I guess.

http://bitsavers.trailing-edge.com/pdf/ibm/6580_Displaywriter/S241-6248-3_Displaywriter_Product_Support_Manual_Feb83.pdf



Sent from my Nexus 5X


Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1696 on: Fri, 25 November 2016, 06:33:34 »
Ah, I see. I wrongly assumed that at least alphas were make/break keys as well. Thanks!

Offline kalmlikabohm

  • Posts: 13
Re: TMK keyboard firmware
« Reply #1697 on: Fri, 25 November 2016, 17:32:33 »
Hookay. So I've tried getting TMK working on this Dactyl. It seems I can get only ONE "Row" working at a time. Either F0 or F1.
I have switched F1 and F0 in the code and get the whole row working at once. I've tested all the switches and wiring, and it seems OK. Using an Ohm meter.

I'm kinda at a loss of getting more than 1 row working at a time.

Is there anything obvious I am messing up?

Any help would be appreciated.


Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1698 on: Fri, 25 November 2016, 21:47:33 »
Nice screenshot. What's your editor?
And what's dactyl? Open design keyboard or something?

I can't find anything in the pics unfortunately. Btw, Your Teensy is genuine?



Sent from my Nexus 5X


Offline hasu

  • Thread Starter
  • Posts: 3319
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1699 on: Fri, 25 November 2016, 21:48:54 »
Nice screenshot. What's your editor?
And what's dactyl? Open design keyboard or something?

I can't find anything wrong in the pics unfortunately. Btw, Your Teensy is genuine?



Sent from my Nexus 5X