Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on methods of processing #1

Open
rbreaves opened this issue Jun 22, 2020 · 0 comments
Open

Notes on methods of processing #1

rbreaves opened this issue Jun 22, 2020 · 0 comments

Comments

@rbreaves
Copy link
Owner

rbreaves commented Jun 22, 2020

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant