Author Topic: creating a FN button  (Read 2784 times)

0 Members and 1 Guest are viewing this topic.

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« on: Thu, 09 December 2010, 12:08:47 »
I've been trying to figure out a way to create the FN functionality in my v2 mod. Basically we know FN+ (whatever) gives us a different set, like in laptops youd have jklui78 as the tenkey and maybe some media functions (like f1=play f2=stop)

i've been trying to basically connect 4 pins/wires to a keyswitch, and when one on/off spdt switch is pressed the key functions as one key or another (for example "j" can be "1")

But i'm at a loss how to do this across the board with 1 FN switch w/o having all these wires crossed, i was thinking about making an entire mini board for it, but just can't figure out how that'd go.

any suggestions would be nice, i'm at a complete loss now, it's not "crucial" i have this in my v2 mod, i just thought it'd be nice to have and cool to implement.
(i do not want to have this implemented in software or AHK, only hardware).

Offline sixty

  • Posts: 984
    • http://deskthority.net
creating a FN button
« Reply #1 on: Thu, 09 December 2010, 12:41:03 »
Quote from: Lanx;260200
I've been trying to figure out a way to create the FN functionality in my v2 mod. Basically we know FN+ (whatever) gives us a different set, like in laptops youd have jklui78 as the tenkey and maybe some media functions (like f1=play f2=stop)

i've been trying to basically connect 4 pins/wires to a keyswitch, and when one on/off spdt switch is pressed the key functions as one key or another (for example "j" can be "1")

But i'm at a loss how to do this across the board with 1 FN switch w/o having all these wires crossed, i was thinking about making an entire mini board for it, but just can't figure out how that'd go.

any suggestions would be nice, i'm at a complete loss now, it's not "crucial" i have this in my v2 mod, i just thought it'd be nice to have and cool to implement.
(i do not want to have this implemented in software or AHK, only hardware).

I don't think you can easily do this in just pure hardware without the cable mess. The only logical solution is that it has to be solved in code in the keyboard controller firmware.

Pseudo code:

Code: [Select]
if(j_key_down()){
   if(fn_key_down()){
      send_scancode(num_1);
   } else {
      send_scancode(j);
   }
}

At least this is how all of the laptop FN keys should work, purely firmware based.

Offline Findecanor

  • Posts: 5042
  • Location: Koriko
creating a FN button
« Reply #2 on: Thu, 09 December 2010, 13:17:22 »
The easiest way would be to use a key remapping tool.

Under Unix/Linux, you could map the key you want as Fn to be some obsolete rare modifier and map your wanted Fn-key combos to that modifier.
🍉

Offline theferenc

  • Posts: 1327
creating a FN button
« Reply #3 on: Thu, 09 December 2010, 13:20:15 »
Do you use xmodmap or the xkb control functions to do that?

I've been trying to make that work in conjunction with synergy for a while, but it just fails a lot.
HHKB Pro 2 -- Custom UNIX layout Unicomp Customizer 101 -- IBM Model M 1391401 (modded to UNIX layout) -- IBM 1397000 (also UNIX layout) -- SSK in UNIX layout -- Model F 122 key in UNIX layout (Soarer USB "native")
 
CST L-TracX trackball -- Kensington Expert Mouse trackball

Offline cbf123

  • Posts: 82
creating a FN button
« Reply #4 on: Thu, 09 December 2010, 15:51:48 »
Quote from: theferenc;260221
Do you use xmodmap or the xkb control functions to do that?

I've been trying to make that work in conjunction with synergy for a while, but it just fails a lot.


I haven't actually tried it, but from the man page it seems like you should be able to do the equivalent of an Fn key with xmodmap by binding a keycode to "Mode_switch" and then specifying the third keysym for the keycodes in question.
Daily drivers are:
Microsoft Natural (the original, and still going strong)
Microsoft Natural Elite

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« Reply #5 on: Thu, 09 December 2010, 18:45:41 »
is xmodmap basically autohotkey stuff?
do not want... guess i might have to look into building my own transistor!

Offline HaaTa

  • Master Kiibohd Hunter
  • Posts: 794
  • Location: San Jose, CA, USA
  • Kiibohds!
    • http://kiibohd.com
creating a FN button
« Reply #6 on: Thu, 09 December 2010, 19:26:56 »
If you want to do something with xmodmap, I can probably help.

You can use the ISO Shift Level 3 and 5, for alternate layouts fairly easily. Provided your xkb has been initialized properly.
If you want to do it with loadkeys (I can also help). You should be able to do it with some of the upper shift levels.
Haven't had the time to figure it out completely with xkb though.

So, let me know if you want some example configs.

As well, xmodmap is not like autohotkey. There are no if statements, just key assignments (with various levels). It is just a means to tell xkb to do some modifications to the current keymap lookup table (e.g. native).
« Last Edit: Thu, 09 December 2010, 19:54:40 by HaaTa »
Kiibohd

ALWAYS looking for cool and interesting switches
I take requests for making keyboard converters (i.e. *old keyboard* to USB).

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« Reply #7 on: Thu, 09 December 2010, 21:44:12 »
would i be better off connecting the switches to a teensy++ and have that as my intermediary?
(note i have no idea how to program or whatever with the teensy)

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« Reply #8 on: Thu, 09 December 2010, 21:50:48 »
hmmm searching for teensy on ebay brings... less than desirable results. (i just want the board no extra fluff!)

Offline msiegel

  • Posts: 1230
creating a FN button
« Reply #9 on: Thu, 09 December 2010, 21:56:01 »
Quote from: Lanx;260429
hmmm searching for teensy on ebay brings... less than desirable results. (i just want the board no extra fluff!)


i bought mine from here... although this is the small one, not the big one with more pins

http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=199

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« Reply #10 on: Thu, 09 December 2010, 22:06:38 »
i don't even know what i should buy or what works with what i'm thinking lol! (someone please tell me i'll be on the right track if the teensy is the way to go)
link appreciated.

Offline hasu

  • Posts: 3475
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
creating a FN button
« Reply #11 on: Thu, 09 December 2010, 22:11:12 »
I found teensy++ is back in stock now!! see PJRC store.
I will buy another one for next project.

p.s.
I recommend teensy++ for its clean pinouts and
"without header pins" is better for installment inside not-roomy keyboard.
http://www.pjrc.com/store/teensypp.html

Offline Lanx

  • Thread Starter
  • Posts: 1915
creating a FN button
« Reply #12 on: Thu, 09 December 2010, 22:22:00 »
the pin ones aren't even in stock anyway. But they have like 9$ shipping, which i wouldn't mind but that's like 50% of the thing and it's the size of a flash drive...