Skip to content

Notes on methods of processing #1

@rbreaves

Description

@rbreaves

It is important to have an established process of how to reconcile shortcuts between OS's. My preferred method will be to use Perl and Regex to accomplish this.

A lot of the following will be a mix of pseudo-like code and regex.

  1. Remove any possible header or mention of commonly used shortcuts (assuming they are repeated in the file). Commonly used shortcuts however could be useful for cheatsheet like applications, so it is desirable to have.

  2. Remove any shortcuts that already match between Source and Destination OS.

  • Win/Linux <=> macOS

If Win <=> macOS Then remove Linux column
Regex: /(.+),.+?$/$1/gm

If Linux <=> macOS Then remove Windows column
Simple Regex: /^(.?),(.?),(.?),(.?)$/$1,$4,$3/gm

Regex that accepts commas in between double quotes: /^("(.+?)"|(.?)),("(.+?)"|(.?)),("(.+?)"|(.?)),("(.+?)"|(.?))$/$7::$4 ;$1/gm

  1. Remove rows that have matching keymaps.
    Note: Ctrl & Cmd are matching. Ctrl & Ctrl are not, if those exist then Ctrl will be Super/Win for a mac remap as that is the physical Ctrl key.
  • Read csv into a list, array, or 2d array and begin the clean up process.
  • 1st Find all Existing matching in plain text. Alt = Alt are the only real matches.
  • Remove matches from list/array
  • 2nd Ctrl = Ctrl matches will need Super/Win to Ctrl keymaps to be automatically generated for proper remap.
  • Remove matches from list/array
  • 3rd Update remaining, all Cmd references should convert to Ctrl, run another check.
  • All keymaps that do not need remapping should be eliminated
  • What remains should be the "wildly different" keymaps.
  • Apply the proper key remap symbols or logic for Autohotkey or xkeysnail to properly map what remains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions