Author Topic: Easy AVR USB Keyboard Firmware and Keymapper  (Read 570197 times)

0 Members and 1 Guest are viewing this topic.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #950 on: Sat, 23 May 2015, 03:24:48 »
If you're going big why not allow a whole Teensy 2.0++ so someone can handwire thier battleship board - 46 pins! ;)

Seriously though, that sounds like plenty and I'm intrigued by Zukoi's request but I'm in Linux so can't test - any chance of a multiplatform build or is it too unstable? :)
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #951 on: Sat, 23 May 2015, 07:21:55 »
2.0++ uses a different AVR.

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #952 on: Sat, 23 May 2015, 10:48:40 »
Very nice!

Here is a comparison between a HANDWIRE JD45 and an actual JD45 layout (new version at top.)

I'll do some firmware building and testing later this weekend.

Thanks very much indeed!

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

p.s.  This also shows the discerning reader my "extra column" cheat.

101447-0

I think 100% configurable is too much to ask for.

Well it's not 100%, but it's a step in the right direction.  I've made a new beta version.  https://www.dropbox.com/s/8kqx2iotb9mhgzv/Easy_keymap_20150522.zip?dl=0

I expanded the hand-wired hardware to be 6x18x4 with backlighting support.  That's more IO pins than exist on an ATmega32U4, but now some of them can be assigned to "NA" (for not applicable).  So you can choose to have a huge matrix with 1 LED, or a smaller matrix with 4 LEDs.

Also, for Zukoi, it now allows you to specify several hand-wired hardware configurations, and you pick which one you want at build time.  This allows you to have multiple boards with different pinouts.
« Last Edit: Sat, 23 May 2015, 10:50:11 by samwisekoi »
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #953 on: Sat, 23 May 2015, 13:44:49 »
2.0++ uses a different AVR.
Other firmwares just work, have you tried yours and found it not to?  If not I'll give it a go, as long as I can find the Soarer's currently on my Ducky (it has a random matrix so no EasyAVR option!)
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #954 on: Sun, 24 May 2015, 12:00:05 »
Did you give the Techkeys card some thought?

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #955 on: Mon, 25 May 2015, 18:29:21 »
Actually, on another thought, I know you said that the Gon Nerd60 isn't supported because of the bootloader on the AVR itself...but let's say I replaced the chip (which I did...) is it relatively easy to utilize your programmer for it?

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #956 on: Mon, 25 May 2015, 18:56:07 »
Actually, on another thought, I know you said that the Gon Nerd60 isn't supported because of the bootloader on the AVR itself...but let's say I replaced the chip (which I did...) is it relatively easy to utilize your programmer for it?

Replaced it with what?  If it's a USB AVR (ATmegaXXUX or AT90USBXXX) then it will work, yes.

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #957 on: Mon, 25 May 2015, 18:58:47 »
Did you give the Techkeys card some thought?

It's going to be tough to get to this, to be honest, but I'm willing to work with someone if they want to provide code.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #958 on: Mon, 25 May 2015, 19:00:03 »
I tested the Teensy 2.0++ and you're right - it didn't work.  Not sure how other firmwares do with no modification but it is what it is.

Actually, on another thought, I know you said that the Gon Nerd60 isn't supported because of the bootloader on the AVR itself...but let's say I replaced the chip (which I did...) is it relatively easy to utilize your programmer for it?

If you know the matrix layout all you need to do is pretend it's a handwire and follow the instructions for that.  From helping someone repair one not long ago it was easy enough to work out the bits we could find pics for, but if half of it is hiding under a plate you might need to check continuity between switches/far side of diodes to map it out :)
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #959 on: Mon, 25 May 2015, 19:05:17 »
I tested the Teensy 2.0++ and you're right - it didn't work.  Not sure how other firmwares do with no modification but it is what it is.

There are a few considerations. (location of bootloader, schedule timing, available RAM, I/O ports, etc)  However if someone puts together a board with one of those, I'll be happy to make a new binary.  Right now I'm concentrating on upgrading the LED support.
« Last Edit: Mon, 25 May 2015, 19:06:48 by metalliqaz »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #960 on: Mon, 25 May 2015, 19:10:32 »
I tested the Teensy 2.0++ and you're right - it didn't work.  Not sure how other firmwares do with no modification but it is what it is.

There are a few considerations.  However if someone puts together a board with one of those, I'll be happy to make a new binary.  Right now I'm concentrating on upgrading the LED support.

It's a crazily big controller for a handwired project but I guess someone could make a fullsize board and stick one on the bottom of it.  LEDs sound much more fun, I must order some! :))
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #961 on: Mon, 25 May 2015, 19:56:20 »
Did you give the Techkeys card some thought?

It's going to be tough to get to this, to be honest, but I'm willing to work with someone if they want to provide code.

To be honest...this isn't even that big of a deal, it'd just be cool to get this little assed thing to be able to do 15 different things, haha. The code for the project is here...I'm probably one of the few people aside from CPTBadAss that might find this useful...I think...maybe not. Either way, if you need the card...let me know I could send it to you...

Actually, on another thought, I know you said that the Gon Nerd60 isn't supported because of the bootloader on the AVR itself...but let's say I replaced the chip (which I did...) is it relatively easy to utilize your programmer for it?

Replaced it with what?  If it's a USB AVR (ATmegaXXUX or AT90USBXXX) then it will work, yes.

Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?
« Last Edit: Mon, 25 May 2015, 20:02:46 by RavenII »

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #962 on: Mon, 25 May 2015, 21:07:15 »
Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?

The configuration of the hardware.  Basically, which I/O pins correspond to rows/cols/leds?

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #963 on: Mon, 25 May 2015, 21:31:00 »
Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?

The configuration of the hardware.  Basically, which I/O pins correspond to rows/cols/leds?

Fair enough, I'll map it out...Or take some high res pics for some to help, I'm just starting to learn about matrices and AVRs...

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #964 on: Tue, 26 May 2015, 11:59:36 »
Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?

The configuration of the hardware.  Basically, which I/O pins correspond to rows/cols/leds?

I'll need to use the ++ for the GH-122/152 just to get a big enough matrix.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline VinnyCordeiro

  • Posts: 432
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #965 on: Tue, 26 May 2015, 12:13:53 »
Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?

The configuration of the hardware.  Basically, which I/O pins correspond to rows/cols/leds?

I'll need to use the ++ for the GH-122/152 just to get a big enough matrix.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.
Or you can use the ATmega32U4/Teensy 2 with some demultiplexers, as seen on Project Zeta post, and clever firmware coding. The 74HC154 in the example even have a through hole version, for those who are afraid of SMD soldering.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #966 on: Wed, 27 May 2015, 03:02:58 »
I'll need to use the ++ for the GH-122/152 just to get a big enough matrix.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

:eek: You're going to handwire that beast?!
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #967 on: Wed, 27 May 2015, 08:50:06 »
I'll need to use the ++ for the GH-122/152 just to get a big enough matrix.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

:eek: You're going to handwire that beast?!

No, no.  But I will need the pin count provided by a Teesny 2.0 ++.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #968 on: Wed, 27 May 2015, 09:24:42 »
So the Teensy2.0++ uses the much larger AT90USB128 microcontroller, which is binary compatible with the Teensy2.0's ATmega32U4, however it isn't practical to make one build that runs on both because the much larger matrix means more memory usage (both RAM and ROM) and scan time, and it's more than the smaller AVR can handle.  Also the bootloader is in a different location and the list of available I/O pins is different.  Therefore, I'll probably just create a new target, handwire_big, to handle that.  I will probably will wait until I have a new project going or Sam has something built because it is probably going to require a bit of testing.

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #969 on: Wed, 27 May 2015, 10:25:18 »
So the Teensy2.0++ uses the much larger AT90USB128 microcontroller, which is binary compatible with the Teensy2.0's ATmega32U4, however it isn't practical to make one build that runs on both because the much larger matrix means more memory usage (both RAM and ROM) and scan time, and it's more than the smaller AVR can handle.  Also the bootloader is in a different location and the list of available I/O pins is different.  Therefore, I'll probably just create a new target, handwire_big, to handle that.  I will probably will wait until I have a new project going or Sam has something built because it is probably going to require a bit of testing.

I'd say wait.  The other thing the 2.0++ provides is MUCH more memory, which would be awesome for more RAM macros.  And the potential for LED control is really good with the bigger processor.  There is even a small display that would look awesome where the Model M indicator LED panel normally goes.

But yes, let's wait until there is something that NEEDS all of those pins!

Meanwhile, perhaps I'll make one of my teenagers learn Python over the summer.  <evil grin>

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

p.s.  Trivial request:  Could you please put the release date into the about box?  It currently says something like "Version 12", but we all (or at least me all) think of the various versions as 20150522, etc.  Thanks!
« Last Edit: Wed, 27 May 2015, 10:30:11 by samwisekoi »
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline vvp

  • Posts: 775
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #970 on: Wed, 27 May 2015, 13:29:34 »
Or you can use the ATmega32U4/Teensy 2 with some demultiplexers, as seen on Project Zeta post, and clever firmware coding. The 74HC154 in the example even have a through hole version, for those who are afraid of SMD soldering.
74HC164 serialIn/parallelOut 8 bit shift register is cheaper (at least just now on farnell) and requires only 2 pins instead of 3 and you can scale it to more bits without a need for more pins.

Offline VinnyCordeiro

  • Posts: 432
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #971 on: Wed, 27 May 2015, 13:54:37 »
Or you can use the ATmega32U4/Teensy 2 with some demultiplexers, as seen on Project Zeta post, and clever firmware coding. The 74HC154 in the example even have a through hole version, for those who are afraid of SMD soldering.
74HC164 serialIn/parallelOut 8 bit shift register is cheaper (at least just now on farnell) and requires only 2 pins instead of 3 and you can scale it to more bits without a need for more pins.
That'll add too much complexity to the firmware, and timing problems would certainly happen. Using a demux may be not so efficient in terms of pin usage, but it is fast and firmware needs just a small tweak. I already saw an example of this in tmk_keyboard.

Offline meow a cat

  • Posts: 531
  • Location: British Columbia, Canada
  • Resistance is futile.
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #972 on: Thu, 28 May 2015, 08:57:10 »
Does anyone know if  it's possible to do macro functions like these using EasyAVR?

LSHIFT & RSHIFT pressed simultaneously = CAPS LOCK

LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK (sort of like on an SSK?)

Also, quick feature request for Metalliqaz. I don't know if it's possible or not, but I'd love to have a system power scancode, so I could do something like FN + ESC = shut down my PC.

Boards:
Silver 84-key KMAC LE, 62g lubed & stickered ergo-clears, GON NerD PCB, polycarbonate plate,MX lock/Phosphorglow IBM Model M SSK 1391472/White HHKB Pro 2, Hasu controller/WKL Phantom, 50g vintage blacks, MX lock
Leeku G80-1800 (build in progress)

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #973 on: Thu, 28 May 2015, 09:11:55 »
The first you can do with Auto Hot Key (Win) or Keyboard Shortcuts (Linux).  The second you can't do at present unless you use the tap mode, which I think is a problem for normal Shift use.

The current release lets you use modifiers IN the key assignments, but not to CONTROL the key assignments.

(But it would be very handy if it did both!)

HID_KEYBOARD_SC_POWER is available already.  You might also have to enable it in BIOS; some motherboards ignore it by default.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

Does anyone know if  it's possible to do macro functions like these using EasyAVR?

LSHIFT & RSHIFT pressed simultaneously = CAPS LOCK

LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK (sort of like on an SSK?)

Also, quick feature request for Metalliqaz. I don't know if it's possible or not, but I'd love to have a system power scancode, so I could do something like FN + ESC = shut down my PC.
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #974 on: Thu, 28 May 2015, 09:40:35 »
Does anyone know if  it's possible to do macro functions like these using EasyAVR?

LSHIFT & RSHIFT pressed simultaneously = CAPS LOCK

LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK (sort of like on an SSK?)

These two mappings are (mostly) technically possible to implement right now with the current scheme...
* Make your Default layer and your Fn layer as you wish
* Copy Default to Layer 2
* on Default, assign FN2 to the left Shift key, and check the "with mod: shift" box
* on Layer 2, assign Caps Lock to the right Shift key
* on Layer 2, assign FN to the scroll lock key as a Toggle (no way to do numlock there)

So this is close, but I know it's not really what you're looking for.  The problem is, how could your mappings be implemented in a general-purpose way?  I need to be able to capture the mappings in the GUI and implement them in the firmware in a way that's not specific to a single user.  In the past, I've mentioned scope when faced with issues like this. If you need to do complicated programming that can't be done with layers, dual-use keys, implied mods, and macros, then you may have graduated to TMK, because this is supposed to be "Easy".

Now, having said that, if someone can think of a straightforward way to capture a mapping like "LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK", then I will implement it.  However I can't think of one.

Also, quick feature request for Metalliqaz. I don't know if it's possible or not, but I'd love to have a system power scancode, so I could do something like FN + ESC = shut down my PC.

I added those codes when I implemented media keys, and then disabled them for some reason.  I can't remember why.  I must have had trouble getting them to work.  The the HID_KEYBOARD_SC_POWER key is only used for Macs, I believe.  I can look into it.

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #975 on: Thu, 28 May 2015, 10:14:39 »
Perhaps the answer is better macros.  If a macro could be created that manipulated layers, then a lot more functionality could be unlocked.  Perhaps a \LAYER(2) to toggle a layer.

Offline Muffin860

  • Posts: 58
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #976 on: Thu, 28 May 2015, 10:35:12 »
Could this be used to make a leopold keypad behave like a real keypad?
IBM Model M

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #977 on: Thu, 28 May 2015, 10:37:28 »
Could this be used to make a leopold keypad behave like a real keypad?

Sorry, no.  This firmware runs on Atmel's USB AVR parts.  The Leopold does not use an AVR controller.  It's not programmable at all, as far as I know.

Offline Muffin860

  • Posts: 58
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #978 on: Thu, 28 May 2015, 10:45:37 »
Could this be used to make a leopold keypad behave like a real keypad?

Sorry, no.  This firmware runs on Atmel's USB AVR parts.  The Leopold does not use an AVR controller.  It's not programmable at all, as far as I know.
Shucks. Thanks for the quick response. I have tried HID macros, and it kinda works, but it is unreliable, and luamacros confuses the hell out of me. I really am hoping to find an easy way to fix this damn thing without putting a teensy in it.
IBM Model M

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #979 on: Thu, 28 May 2015, 10:53:26 »
Perhaps the answer is better macros.  If a macro could be created that manipulated layers, then a lot more functionality could be unlocked.  Perhaps a \LAYER(2) to toggle a layer.

When I first saw the UI update that added the "With mods:" row, I thought "Ah ha!" he's added modifiers to CONTROL keypresses.  And that is what I (personally) think you should do in this instance.

Using the existing UI, make "(1,1) with_mods(Shift_L)" be another mapping on the same layer.  We can already do M1=\CTRLcv to make a "copy then paste" key.   We cannot do a LSHIFT + RSHIFT = NUMLOCK string.

More on this thought when I don't have to rush a child to school.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline meow a cat

  • Posts: 531
  • Location: British Columbia, Canada
  • Resistance is futile.
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #980 on: Thu, 28 May 2015, 12:05:26 »
Does anyone know if  it's possible to do macro functions like these using EasyAVR?

LSHIFT & RSHIFT pressed simultaneously = CAPS LOCK

LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK (sort of like on an SSK?)

These two mappings are (mostly) technically possible to implement right now with the current scheme...
* Make your Default layer and your Fn layer as you wish
* Copy Default to Layer 2
* on Default, assign FN2 to the left Shift key, and check the "with mod: shift" box
* on Layer 2, assign Caps Lock to the right Shift key
* on Layer 2, assign FN to the scroll lock key as a Toggle (no way to do numlock there)

So this is close, but I know it's not really what you're looking for.  The problem is, how could your mappings be implemented in a general-purpose way?  I need to be able to capture the mappings in the GUI and implement them in the firmware in a way that's not specific to a single user.  In the past, I've mentioned scope when faced with issues like this. If you need to do complicated programming that can't be done with layers, dual-use keys, implied mods, and macros, then you may have graduated to TMK, because this is supposed to be "Easy".

Now, having said that, if someone can think of a straightforward way to capture a mapping like "LSHIFT & SCROLL LOCK pressed simultaneously = Toggle FN layer, press NUM LOCK", then I will implement it.  However I can't think of one.

Also, quick feature request for Metalliqaz. I don't know if it's possible or not, but I'd love to have a system power scancode, so I could do something like FN + ESC = shut down my PC.

I added those codes when I implemented media keys, and then disabled them for some reason.  I can't remember why.  I must have had trouble getting them to work.  The the HID_KEYBOARD_SC_POWER key is only used for Macs, I believe.  I can look into it.

Your workaround for the double shift macro could work for me, I will try it out.

I understand what you mean when you talk about scope; I just really enjoy using your firmware, so I'd prefer to stick with it if I can.

I came up with those mappings from using Soarers. I'd love to see EasyAVR have similar capabilities for macros.

Of course, I could use Soarers instead, but then I lose the features of EasyAVR that I love. Tap keys are great!

I still haven't figured out how to do anything with TMK yet. It's all over my head so far.  :))

Thanks for looking into the power key for me, that would be awesome!

Perhaps the answer is better macros.  If a macro could be created that manipulated layers, then a lot more functionality could be unlocked.  Perhaps a \LAYER(2) to toggle a layer.

When I first saw the UI update that added the "With mods:" row, I thought "Ah ha!" he's added modifiers to CONTROL keypresses.  And that is what I (personally) think you should do in this instance.

Using the existing UI, make "(1,1) with_mods(Shift_L)" be another mapping on the same layer.  We can already do M1=\CTRLcv to make a "copy then paste" key.   We cannot do a LSHIFT + RSHIFT = NUMLOCK string.

More on this thought when I don't have to rush a child to school.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

This looks like exactly what I am looking for. We could get even more functionality out of a single layer without getting in the way of other keys on the layer.

I think it would add a lot of capability to EasyAVR if we had the ability to do macros in this way.

Thank you Metalliqaz, and Samwise, for your responses!  :thumb:

P.S. I love the new hint macro, super useful! Especially useful on my JD40.  ;D

Boards:
Silver 84-key KMAC LE, 62g lubed & stickered ergo-clears, GON NerD PCB, polycarbonate plate,MX lock/Phosphorglow IBM Model M SSK 1391472/White HHKB Pro 2, Hasu controller/WKL Phantom, 50g vintage blacks, MX lock
Leeku G80-1800 (build in progress)

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #981 on: Thu, 28 May 2015, 14:33:50 »
Perhaps the answer is better macros.  If a macro could be created that manipulated layers, then a lot more functionality could be unlocked.  Perhaps a \LAYER(2) to toggle a layer.

When I first saw the UI update that added the "With mods:" row, I thought "Ah ha!" he's added modifiers to CONTROL keypresses.  And that is what I (personally) think you should do in this instance.

Using the existing UI, make "(1,1) with_mods(Shift_L)" be another mapping on the same layer.  We can already do M1=\CTRLcv to make a "copy then paste" key.   We cannot do a LSHIFT + RSHIFT = NUMLOCK string.

More on this thought when I don't have to rush a child to school.

 - Ron | samwisekoi
Auto-typed by my JD45 keyboard.

I'm not following.  What are CONTROL keypresses and how are they different from regular keypresses?  Every key on a single layer gets one mapping.  There is not enough memory to store data of arbitrary length at every location.  I also don't understand what "(1,1) with_mods(Shift_L)" means.


Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #982 on: Thu, 28 May 2015, 18:11:01 »
More words now -- this morning I was literally getting up from my desk to zoom a child to school.

What I am about to describe might not be practical, do-able, a good idea, or something you want to even consider thinking about the possibility of imagining doing.  This is an expanded definition only. Please excuse the pedantry; I am trying to be specific, not patronizing.  I may fail in that goal.  (Sorry.)

--

The context here is a SINGLE LAYER within Easy Keymap.  For purposes of this description I will use a 60% keyboard like the GH60.  The GH60 has five rows (0-4) and fifteen columns (0-14).  The keys in the GH60 matrix can be described using layout coordinates of (row,column) so the upper left key (Escape or Tilde) is (0,0) and the Space bar is something like (4,5).  For the purposes of pseudo-code, I will create an imaginary function called KEYMAP() that takes three arguments, row, column, and scancode assignment.

So this is how to make that upper-left key be escape:

KEYMAP(0,0) == HID_KEYBOARD_SC_ESCAPE


The latest versions of Easy Keymap extend this by adding modifiers to the assignment as shown here:

KEYMAP(0,0) ==  HID_KEYBOARD_SC_LEFT_SHIFT + HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE


I am proposing the modifiers be moved to the other side of the assignment operator as shown here.  The first line shows what an unmodified keypress delivers.  The second line, which I will call "IFMOD" shows what is assigned to KEYMAP(3,0) IFMOD (RSHIFT) is active.


KEYMAP(3,0) ==  HID_KEYBOARD_SC_LEFT_SHIFT                         # Unchanged from current
KEYMAP(3,0,RSHIFT) ==  HID_KEYBOARD_SC_NUM_LOCK                    # Additional argument added
     

That is the pseudo-code for what I was describing this morning.  Even if this is a bad idea, is that description clearer?

Not knowing the code or internal architecture of Easy Keymap, I can only speculate about implementation paths.  Looking at generated source, I don't see where you are storing the current "With mods:" data.  (Perhaps they don't make it to generated source.)  The proposed "IFMOD" could be implemented as state bits, while loops, fixed function layers, or multiple assignments to a single position.

As I said, it might not be practical, or even a good idea.  But that was what I meant.

Thanks for considering!  (And jeez, for freaking everything else your code has enabled!)

Best,

 - Ron | samwisekoi
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #983 on: Thu, 28 May 2015, 19:25:34 »
Yeah, the one on my Nerd60 is a Atmega32u4-AU ....I figured since Gon doesn't provide his bootloader...I'd save it by just swapping out the chip. What info would you need for supporting this board? or can I just use the GH60 setting?

The configuration of the hardware.  Basically, which I/O pins correspond to rows/cols/leds?

PE6 Col 0
PB0 Col 1
PB1 Col 2
PB2 Col 3
PB3 Col 4
PF0 Col 5
PD0 Col 6
PD5 Col 7

PB4 Row 0
PE2 Row 1
PF4 Row 2
PF7 Row 3
PF1 Row 4
PF6 Row 5
PC6 Row 6
PF5 Row 7
PD7 Row 8
PC7 Row 9

PB7 In-switch
PB6 "Side LEDs"
PB5 Caps Lock

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #984 on: Fri, 29 May 2015, 11:31:07 »
The context here is a SINGLE LAYER within Easy Keymap.  For purposes of this description I will use a 60% keyboard like the GH60.  The GH60 has five rows (0-4) and fifteen columns (0-14).  The keys in the GH60 matrix can be described using layout coordinates of (row,column) so the upper left key (Escape or Tilde) is (0,0) and the Space bar is something like (4,5).  For the purposes of pseudo-code, I will create an imaginary function called KEYMAP() that takes three arguments, row, column, and scancode assignment.

So this is how to make that upper-left key be escape:

KEYMAP(0,0) == HID_KEYBOARD_SC_ESCAPE


The latest versions of Easy Keymap extend this by adding modifiers to the assignment as shown here:

KEYMAP(0,0) ==  HID_KEYBOARD_SC_LEFT_SHIFT + HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE


I am proposing the modifiers be moved to the other side of the assignment operator as shown here.  The first line shows what an unmodified keypress delivers.  The second line, which I will call "IFMOD" shows what is assigned to KEYMAP(3,0) IFMOD (RSHIFT) is active.


KEYMAP(3,0) ==  HID_KEYBOARD_SC_LEFT_SHIFT                         # Unchanged from current
KEYMAP(3,0,RSHIFT) ==  HID_KEYBOARD_SC_NUM_LOCK                    # Additional argument added
     

Here's how it currently works (simplified):

The mapping function takes three arguments, and returns four things

KEYMAP(row, col, layer) -> (scancode, modifiers, mode, tapkey)

Supplying those four results takes 3 bytes per matrix location, and is maxing out memory usage

So consider I mapped Fn+Del to be the same as CTRL+ALT+DEL.  It would look like this:

KEYMAP(2, 14, 0) -> (HID_KEYBOARD_SC_DELETE, 0, 'normal', 0)
KEYMAP(2, 14, 1) -> (HID_KEYBOARD_SC_DELETE, (Ctrl|Alt), 'normal', 0)

Or if I mapped Fn+Esc to be my flip key, it would look like this:

KEYMAP(0, 0, 0) -> (HID_KEYBOARD_SC_ESCAPE, 0, 'normal', 0)
KEYMAP(0, 0, 1) -> (SCANCODE_BOOT, 0, 'normal', 0)

Or if I mapped a SpaceFn layout, I might have something like this:

KEYMAP(5, 6, 0) -> (SCANCODE_FN, 0, 'tapkey', HID_KEYBOARD_SC_SPACE)

Where am I going with this?

When you look at it in this context, I think what you're actually proposing is a shift layer.  What I'm saying is if you just rename "shift layer" to "Layer 3", you've already got it.

Actually I haven't even finished reading your post yet, so I could be missing important stuff.  I'm busy lately, but I wanted to respond.

Offline samwisekoi

  • MAWG since 1997
  • * Administrator
  • Posts: 2480
  • Location: Mt. View, California
  • Sorry, moving houses. Be back ASAP.
    • Tweet samwisekoi
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #985 on: Fri, 29 May 2015, 14:46:24 »
When you look at it in this context, I think what you're actually proposing is a shift layer.  What I'm saying is if you just rename "shift layer" to "Layer 3", you've already got it.

@metalliqaz,

Thanks for the technical details.  I tried to sort out how to implement a shift/function layer, and I think it is possible, but ugly.

Assume that we are trying to make LSHIFT + RSHIFT -> NUM_LOCK.

KEYMAP(3,0,0) -> SCANCODE_FN5;
KEYMAP(3,13,5) -> HID_KEYBOARD_SC_NUM_LOCK

That works, hooray!

But wait.  For every other key, LSHIFT should be passed through so the OS can use it as a modifier.  But we can't do that because KEYMAP(3,0,0) -> SCANCODE_FN5;

So that means that on Layer 5 we have to do...

KEYMAP(0,0,5) -> SC_GRAVE_ACCENT_AND_TILDE (SHIFT);
KEYMAP(0,1,5) -> SC_1_AND_EXCLAMATION (SHIFT);
KEYMAP(0,2,5) -> SC_2_AND_AT (SHIFT);
...
KEYMAP(2,1,5) -> SC_A (SHIFT);
KEYMAP(2,2,5) -> SC_S (SHIFT);

And so on for the whole keyboard.

The UX is easy.  Go to Layer 0 (Default), Edit:Copy Layer.  Go to Layer 5, Edit: Paste Layer.  One by one, touch each key and check "With mods: [  ] Shift".

When you are done with that, you will have a layer that acts exactly like the default layer plus shift EXCEPT for LSHIFT + RSHIFT, which will be NUMLOCK.

I agree, that would accomplish the task.  Thanks!

@meow a cat, there is your answer.

 - Ron | samwisekoi

p.s.  It occurs to me that the same method could be (painfully) used to turn CAPS_LOCK into a proper SHIFT_LOCK that included shifting the number row.
« Last Edit: Fri, 29 May 2015, 14:51:13 by samwisekoi »
I like keyboards and case modding.  Everything about a computer should be silent -- except the KEYBOARD!

'85 IBM F-122/Soarer Keyboard |  Leopold FC200 TKL (Browns) + GH36 Keypad (Browns/Greens) | GH-122 (Whites/Greens) with Nuclear Data Green keycaps in a Unicomp case

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #986 on: Mon, 01 June 2015, 11:07:41 »
I edited this post like 4 times already...

First, I've said it before and I'll say it again, I absolutely LOVE this firmware.

Second, on a Frosty Flake, you can't turn the Insert/Home/PU cluster or the arrow keys into tap keys. Well, you can, but it doesn't work...not sure if you're supposed to be able to, just thought I'd let you know in case that's what is meant to happen.
« Last Edit: Mon, 01 June 2015, 11:19:04 by RavenII »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 3282
  • Location: England
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #987 on: Mon, 01 June 2015, 16:53:37 »
@samwisekoi - can't you just tick "with mods: shift" on the FN5 (left shift) key, copy the current layer to layer 5 and then change "right shift" to num lock?  I can't help thinking I'm missing something as it sounds too easy...
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #988 on: Mon, 01 June 2015, 20:29:13 »
First, I've said it before and I'll say it again, I absolutely LOVE this firmware.

Thanks dude, glad you like it

Second, on a Frosty Flake, you can't turn the Insert/Home/PU cluster or the arrow keys into tap keys. Well, you can, but it doesn't work...not sure if you're supposed to be able to, just thought I'd let you know in case that's what is meant to happen.

Tap keys (or dual use keys) only work on Fn and modifier keys.  The reason has to do with the nature of dual use keys.  Since modifiers don't do anything on their own, they can have two mappings.  If the user quickly presses the modifier and nothing else, then it would normally not have done nothing useful, and it can be assumed that they want to use the tap key instead.  On the contrary, it is perfectly normal for a user to tap a normal key.  In fact, that's the usual.  So if you changed it up so you could apply a tapkey to Insert and tapped it, you'd get Insert on the downstroke and the tapkey on the upstroke.  It wouldn't make sense.
« Last Edit: Mon, 01 June 2015, 20:39:00 by metalliqaz »

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #989 on: Mon, 01 June 2015, 20:57:36 »
On the contrary, it is perfectly normal for a user to tap a normal key.  In fact, that's the usual.  So if you changed it up so you could apply a tapkey to Insert and tapped it, you'd get Insert on the downstroke and the tapkey on the upstroke.  It wouldn't make sense.

You make a very good point, I didn't even think of it that way, see I'm still adjusting to a TKL...coming from a full sized KB and I'm so used to tapping enter on the numpad with my thumb while holding my mouse... I was going to change the -> to tap as enter...but reading your response makes me realize that I tap the **** out of the arrow key at times....so yeah. Good call.

Offline Jahiliyyah

  • Posts: 1
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #990 on: Fri, 05 June 2015, 17:10:48 »
I would kill if I could remap the multimedia keys on my razer tarantula. The firmware is woefully outdated, and I'm not even sure what each key is mapped as.

Offline MAR82

  • Posts: 487
  • Location: It says I'm in France
  • Keyboard Addict
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #991 on: Sun, 07 June 2015, 06:29:57 »
I would kill if I could remap the multimedia keys on my razer tarantula. The firmware is woefully outdated, and I'm not even sure what each key is mapped as.

You should look into software like AutoHotkey, since this tool is not made to do what you want.

With AHK you can map any key to any other key, and make macros and lots of other cool things
This tool is made for programming the ATMEGA32U4 micro controller

Offline _nowai

  • Posts: 8
  • Location: GER
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #992 on: Sun, 07 June 2015, 09:53:40 »
Hi, I need some advice with a handwired keyboard and this firmware.
I'm coming from TMK and everything worked great so far. However when I tried this firmware, I adjusted the handwire.cfg and handwire_hardware.cfg, made a layout, built and flashed the hex file and I just couldn't get any output at all, even with the debug firmware. After some troubleshooting I figured the diodes must point in the wrong direction. In this case it's not a big problem, because it's only a 5x4 numpad and I can easily swap rows and colums of the pinout (layout is mirrored and turned by 90 degree though). But I own a Planck as well and I'd like to make it work with Easy AVR. Since the Planck has 12 columns I can't just make them rows.

Is there any other way to deal with this?

Edit: here's a picture of the wiring http://imgur.com/t6IvRc7
« Last Edit: Sun, 07 June 2015, 11:35:13 by _nowai »

Offline Muffin860

  • Posts: 58
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #993 on: Sun, 07 June 2015, 22:00:15 »
Hi, I need some advice with a handwired keyboard and this firmware.
I'm coming from TMK and everything worked great so far. However when I tried this firmware, I adjusted the handwire.cfg and handwire_hardware.cfg, made a layout, built and flashed the hex file and I just couldn't get any output at all, even with the debug firmware. After some troubleshooting I figured the diodes must point in the wrong direction. In this case it's not a big problem, because it's only a 5x4 numpad and I can easily swap rows and colums of the pinout (layout is mirrored and turned by 90 degree though). But I own a Planck as well and I'd like to make it work with Easy AVR. Since the Planck has 12 columns I can't just make them rows.

Is there any other way to deal with this?

Edit: here's a picture of the wiring http://imgur.com/t6IvRc7

You are correct, your diodes are exactly backwards.
IBM Model M

Offline metalliqaz

  • * Maker
  • Thread Starter
  • Posts: 4911
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #994 on: Sun, 07 June 2015, 22:36:27 »
Hi, I need some advice with a handwired keyboard and this firmware.
I'm coming from TMK and everything worked great so far. However when I tried this firmware, I adjusted the handwire.cfg and handwire_hardware.cfg, made a layout, built and flashed the hex file and I just couldn't get any output at all, even with the debug firmware. After some troubleshooting I figured the diodes must point in the wrong direction. In this case it's not a big problem, because it's only a 5x4 numpad and I can easily swap rows and colums of the pinout (layout is mirrored and turned by 90 degree though). But I own a Planck as well and I'd like to make it work with Easy AVR. Since the Planck has 12 columns I can't just make them rows.

Is there any other way to deal with this?

Edit: here's a picture of the wiring http://imgur.com/t6IvRc7

I'm working on it.

Offline _nowai

  • Posts: 8
  • Location: GER
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #995 on: Mon, 08 June 2015, 03:28:40 »
You are correct, your diodes are exactly backwards.
Dang, this is how most of the handwired Plancks are done.

I'm working on it.
Thanks, I really appreciate that! :thumb:

Offline dougp

  • Posts: 14
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #996 on: Wed, 10 June 2015, 08:44:09 »
Any chance we can see the v60 added? 

Offline RavenII

  • Posts: 191
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #997 on: Wed, 10 June 2015, 08:56:01 »
Any chance we can see the v60 added?

It doesn't have the right controller. I'm pretty sure it doesn't.

Offline dougp

  • Posts: 14
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #998 on: Wed, 10 June 2015, 09:09:21 »
Any chance we can see the v60 added?

It doesn't have the right controller. I'm pretty sure it doesn't.

I haven't been able to find much on that topic, so that's why I was curious.  I'd love to be able to customize the Fn layer on my v60.

Offline sethk_

  • Grand Master Wizard Pizza
  • * Esteemed Elder
  • Posts: 2712
  • Location: Pittsburgh, Pennsylvania
  • www.kbdhub.com
    • My webstore
Re: Easy AVR USB Keyboard Firmware and Keymapper
« Reply #999 on: Wed, 10 June 2015, 09:11:36 »
What about the Leeku PCBs, it has a little silkscreen and output that says "AVR-ISP-6", and I was told that they can be programmed through the USB. Thanks!