Author Topic: Soarer's layer combination mapping?  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

Offline Logg

  • Thread Starter
  • Posts: 6
Soarer's layer combination mapping?
« on: Tue, 27 March 2018, 21:16:09 »
Hi there. I've got an IBM Model M122 with a teensy installed inside running soarer's mod. I type in dvorak most of the time, which brings a lot of challenges when it comes to adapting soarer's config for both an operating system that has their keymap in qwerty & one that has it in dvorak.

In fact, I haven't been able to figure out how to make one config that works no matter what keymapping the operating system has.

My config has 3 layers.

Layer 1 is user Depleted Vespene's Hexadecimal numpad idea (great idea, love using it). But because I interract with computers that have the dvorak keymapping in software, in the config, it doesn't say "A B C D E F", it must be "A N I H D Y" to send the correct key codes.

Layer 2 is a mapping to turn the keyboard "natively dvorak". when I press EXTRA_F6, it allows me to type dvorak in an environment that is mapped qwerty. Great stuff, BUT, it doesn't fix all the macros and remaps throughout the rest of the configuration, so e.g. my hex pad types A N I H D Y :( Getting help with this is the primary purpose of this thread. If it were possible to change the mapping of both macroblocks and remapblocks depending on what layers are active, then it would be accomplishable. I think remapblocks can have a layer filter applied (although I haven't been able to work out how...) but I don't see anything for macroblocks.

Layer 3 is a special set of key shortcut remaps for an operating system used on Cisco routers and switches called "Cisco IOS". This I worked out myself, and if you find it useful, great. Basically it translates the archaic keyboard shortcuts apparently unrevised since the mid 80s to normal modern behavior of keypresses (delete key works, home key works, ctrl-arrow works, etc....). None of these work on a system with a qwerty keymapping. Feel free to adapt & use it. Something I noticed though is that I can't map CTRL-SHIFT-6 to EXTRA_F5 or EXTRA_F8... I've had to put it on the INSERT key. If anyone knows why, that would be great...


Code: [Select]
# Soarer Converter's configuration for an IBM Model M122 (1390876) keyboard
# and an F122 (6110345) as well.
#
# Based on: v1.1 of Depleted Vespene's script (20171110), jeb's dvorak mapping
# Author: Logg
# Date: 20180327
# Version: 1.3
#
##### BEGIN ########

force set3 #this converter will never be used with a non-terminal keyboard, so disable the auto-detection for speed

macroblock
  # extra_f4 is located conveniently to the left of TAB.
  # This macro acts as Shift-tab
  macro EXTRA_F4
    PUSH_META CLEAR_META all
    MAKE LSHIFT
    PRESS TAB
    BREAK LSHIFT
    POP_ALL_META
  endmacro

  # Diacritics galore!
  # this does not produce diacritics for me.
  #macro EXTRA_F5
  #  SET_META RALT LSHIFT
  #  onbreak norestoremeta
  #  CLEAR_META LSHIFT RALT
  #endmacro

  #probe for keycodes
#  macro EXTRA_F9
# PUSH_META CLEAR_META all
#    PRESS PAD_EQUALS
#    PRESS F13
#    PRESS F14
#    PRESS F15
#    PRESS F16
#    PRESS F17
#    PRESS F18
#    PRESS F19
#    PRESS F20
#    PRESS F21
#    PRESS F22
#    PRESS F23
#    PRESS F24
#    PRESS EXECUTE
#    PRESS HELP
#    PRESS MENU
#    PRESS SELECT
#    PRESS STOP
#    PRESS AGAIN
#    PRESS UNDO
#    PRESS CUT
#    PRESS PASTE
#    PRESS FIND
#    PRESS MUTE
#    PRESS VOLUME_UP
#    PRESS VOLUME_DOWN
#    PRESS LOCKING_CAPS_LOCK
#    PRESS LOCKING_NUM_LOCK
#    PRESS LOCKING_SCROLL_LOCK
#    PRESS PAD_COMMA
#    PRESS EQUAL_SIGN
#    PRESS INTERNATIONAL_1
#    PRESS INTERNATIONAL_2
#    PRESS INTERNATIONAL_3
#    PRESS INTERNATIONAL_4
#    PRESS INTERNATIONAL_5
#    PRESS INTERNATIONAL_6
#    PRESS INTERNATIONAL_7
#    PRESS INTERNATIONAL_8
#    PRESS INTERNATIONAL_9
#    PRESS LANG_1
#    PRESS LANG_2
#    PRESS LANG_3
#    PRESS LANG_4
#    PRESS LANG_5
#    PRESS LANG_6
#    PRESS LANG_7
#    PRESS LANG_8
#    PRESS LANG_9
#    PRESS ALTERNATE_ERASE
#    PRESS SYSREQ_ATTN
#    PRESS CANCEL
#    PRESS CLEAR
#    PRESS PRIOR
#    PRESS RETURN
#    PRESS SEPARATOR
#    PRESS OUT
#    PRESS OPER
#    PRESS CLEAR_AGAIN
#    PRESS CRSEL_PROPS
#    PRESS EXSEL
#    POP_ALL_META
#  endmacro
 
  # On my M122 (but NOT on the F122), some Alt-Ctrl-arrow combinations
  # don't register properly. I use them a lot, so I need to wade around
  # that problem (and, as it turns out, this key assignment is pretty
  # comfortable).
  # they're right, alt-ctrl-up and alt-ctrl-down don't work. I don't need those though...
  #macro EXTRA_F10
  #  SET_META LALT RCTRL
  #  onbreak norestoremeta
  #  CLEAR_META RCTRL LALT
  #endmacro

  # alt printscreen
  #macro F22
  #  PUSH_META CLEAR_META all
  #  MAKE LALT
  #  PRESS PRINTSCREEN
  #  BREAK LALT
  #  POP_ALL_META
  #endmacro

  # On my national layout, Shift-0 outputs the '=' character. Adjust this
  # as needed for others.
  macro PAD_EQUALS
    PUSH_META CLEAR_META all
    MAKE LSHIFT
    PRESS 0
    BREAK LSHIFT
    POP_ALL_META
  endmacro

endblock


remapblock

# Left-side function keys.
  EXTRA_F1      CAPS_LOCK
  EXTRA_F2      ESC
  EXTRA_F3      PRINTSCREEN
#  EXTRA_F4     (macro above makes this shift-tab)
  EXTRA_F5      SYSTEM_POWER #(macro above could make this control-alt-F1? ctrl-alt-del? delete the contents of the hard drive?) #panic button
  EXTRA_F6      SELECT_2          # Dvorak
  EXTRA_F7      PAUSE        #could be F15
  EXTRA_F8      F16          #
  EXTRA_F9      F17 #EXECUTE #
  EXTRA_F10     F18 # (see macro above, used to be a workaround for ctrl-alt-arrow)

# For footpedals
  AUX1          MEDIA_WWW_BACK
  AUX2          MEDIA_WWW_FORWARD
 
# Main alphanumeric block. This remapping is non-negotiable.
  EUROPE_1    BACKSLASH

# Top-side extra function keys.
  F13           MEDIA_MUTE
  F14           MEDIA_VOLUME_DOWN
  F15           MEDIA_VOLUME_UP
  F16           MEDIA_PLAY_PAUSE
  F17           MEDIA_PREV_TRACK
  F18           MEDIA_NEXT_TRACK
  F19           MEDIA_STOP
  F20           F15
  F21           EXECUTE
  F22           MEDIA_CALCULATOR #(macro above would make it alt-printscreen)
  F23           SELECT_3 #cisco
  F24           SELECT_1 #numpad -> hexpad

# Arrow Keys; only the middle key needs to be reassigned.
  LANG_4        SCROLL_LOCK

  # The numpad's gray keys are made to behave like on a normal keyboard
  # except that the extra key is a comma/semicolon
  ESC           NUM_LOCK
  NUM_LOCK      PAD_SLASH
  SCROLL_LOCK   PAD_ASTERIX
  EXTRA_SYSRQ   PAD_MINUS
  PAD_ASTERIX   PAD_PLUS
  PAD_MINUS     W       #  (extra key maps to comma/semicolon)
  PAD_PLUS      PAD_ENTER
 
  #the missing keys... some day will do a hardware mod to put them back
  CAPS_LOCK     LGUI
  EUROPE_2      APP

endblock

  remapblock #doesn't work...
    layer 2 #dvorak, assumes qwerty native keymap on operating system
      ESC           A #actually A
      NUM_LOCK      B #actually B
      SCROLL_LOCK   C #actually C
      EXTRA_SYSRQ   D #actually D
      PAD_ASTERIX   E #actually E
      PAD_MINUS     F #actually F
      PAD_PLUS      PAD_ENTER
      LANG_4        DOWN
  endblock


# Layer 1 changes the numpad into a hexpad (0..9, A..F and ':').
# also makes arrow keys "normaler"
ifselect 1
  macroblock

    # On my national layout, Shift-. outputs the ':' character. Adjust this
    # as needed.
    macro PAD_PERIOD SHIFT
      PUSH_META CLEAR_META all
      MAKE LSHIFT
      PRESS Z #colon
      BREAK LSHIFT
      POP_ALL_META
    endmacro

  endblock
 
  #for layer 0 qwerty but software dvorak
  remapblock
    #layer 0 #assumes dvorak native keymap on operating system
      ESC           A #actually A
      NUM_LOCK      N #actually B
      SCROLL_LOCK   I #actually C
      EXTRA_SYSRQ   H #actually D
      PAD_ASTERIX   D #actually E
      PAD_MINUS     Y #actually F
      PAD_PLUS      PAD_ENTER
     #PAD_PERIOD    E #(see macro above)
      LANG_4        DOWN
  endblock


# Layer 2 changes the keyboard into native dvorak mode for computers with a qwerty keymapping in software
ifselect 2
  remapblock
  layer 0
     MINUS LEFT_BRACE
     EQUAL RIGHT_BRACE
     Q QUOTE
     W COMMA
     E PERIOD
     R P
     T Y
     Y F
     U G
     I C
     O R
     P L
     LEFT_BRACE SLASH
     RIGHT_BRACE EQUAL
     S O
     D E
     F U
     G I
     H D
     J H
     K T
     L N
     SEMICOLON S
     QUOTE MINUS
     Z SEMICOLON
     X Q
     C J
     V K
     B X
     N B
     COMMA W
     PERIOD V
     SLASH Z
  endblock
# Layer 3 makes certain keys "work" in cisco IOS
# also replicate some "advanced" text editing shortcuts
ifselect 3
macroblock
 
  #map my "panic" button to CTRL-SHIFT-6
  macro INSERT #doesn't work on EXTRA_F5 for some reason...
    PUSH_META CLEAR_META all
      MAKE LCTRL LSHIFT
      PRESS 6
      BREAK LCTRL LSHIFT
    POP_ALL_META 
  endmacro

  #CTRL-D, delete character in front of cursor
  macro DELETE -CTRL
    PUSH_META CLEAR_META all
      MAKE LCTRL
      PRESS H #ctrl-d
      BREAK LCTRL
    POP_ALL_META
  endmacro
 
  #ESC-D, delete word in front of cursor
  #ctrl-left_arrow
  macro DELETE CTRL
    PUSH_META CLEAR_META all
      MAKE ESC
      PRESS H #ESC-D
      BREAK ESC
    POP_ALL_META
  endmacro
 
  #CTRL-A, go to beginning of line
  macro HOME
    PUSH_META CLEAR_META all
      MAKE LCTRL
      PRESS A #ctrl-a
      BREAK LCTRL
    POP_ALL_META
  endmacro
 
  #CTRL-E, go to end of line
  macro END
    PUSH_META CLEAR_META all
      MAKE LCTRL
      PRESS D #ctrl-e
      BREAK LCTRL
    POP_ALL_META
  endmacro
 
  #undo key...?? undoes any key shortcut (hmmmm)
  #ctrl-y
  macro EXTRA_F9
    PUSH_META CLEAR_META all
      MAKE LCTRL
      PRESS f #ctrl-y
      BREAK LCTRL
    POP_ALL_META
  endmacro
 
  #CTRL-W, delete the word behind the cursor
  #ctrl-backspace
  macro BACKSPACE CTRL
    PUSH_META CLEAR_META all
      MAKE LCTRL
      PRESS COMMA #ctrl-W
      BREAK LCTRL
    POP_ALL_META
  endmacro
 
  #ESC-F, move forward one word
  #ctrl-right_arrow
  macro RIGHT CTRL
    PUSH_META CLEAR_META all
      MAKE ESC
      PRESS Y #ESC-F
      BREAK ESC
    POP_ALL_META
  endmacro

  #ESC-B, move backward one word
  #ctrl-left_arrow
  macro LEFT CTRL
    PUSH_META CLEAR_META all
      MAKE ESC
      PRESS N #ESC-B
      BREAK ESC
    POP_ALL_META
  endmacro 

endblock
##### END ##########