Toggle shift for single letter and add "keyboard layout" options.
Open
@magnumripper is already working on this.
Since Nov 22, 2018.
enhancement
RFC / discussion
- Dominant language
- C
- Stars
- 13.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
t toggles case (a<->A) for whole word and TN toggles position N only.
S toggles shift (eg. a<->A and 4<->$) for whole word. It's a superset of t. Unfortunately there is no variant similar to TN for a single position.
I experimented with this (nearly identical to the TN code) that implements toggle shift of character at position N as WN, and it has proven useful.
diff --git a/src/rules.c b/src/rules.c
index 0016b97e1..308943779 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1794,6 +1794,14 @@ char *rules_apply(char *word_in, char *rule, int split, char *last)
in[0] = 0;
break;
+ case 'W':
+ {
+ int pos;
+ POSITION(pos)
+ in[pos] = conv_shift[ARCH_INDEX(in[pos])];
+ }
+ break;
+
case 'S':
CONV(conv_shift);
break;
I picked W because it was the first unused one (in qwerty order). @solardiz @jsteube is WN OK or would you prefer some other letter?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.