- CLIPBOARD:
- This contains copied data.
- Copy data by selecting text and pressing Ctrl+c or right-clicking and choosing copy from the context menu.
- Paste data by pressing Ctrl+v or pressing Shift+Insert or right-clicking the mouse and choosing paste to paste.
- AutoKey's
clipboard.get_clipboard()
andclipboard.fill_clipboard()
API calls can access this.
- PRIMARY:
- This contains selected data.
- Its purpose is to contain the only argument to commands that take one argument and is the principal means of communication between clients that use the selection mechanism.
- Select data by selecting text.
- Paste data by pressing the middle mouse button.
- AutoKey's
clipboard.get_selection()
andclipboard.fill_selection()
API calls can access this.
- SECONDARY:
- This contains selected data.
- Its purpose is to either contain the second argument to commands that take two arguments or to contain additional data when there's already a primary selection that the user doesn't want to disturb.
- Select data by holding down the meta or Alt key while selecting text.
- Paste data by holding down the meta or Alt key while pressing the middle mouse button.
- AutoKey doesn't have API calls to access this.
- With the keyboard:
- Hold down the Shift key while pressing any of the arrow keys.
- Hold down the Shift key while pressing the Home or End button.
- Hold down the Shift key while pressing the PgUp or PgDn button.
- Hold down the Ctrl and Shift and End keys.
- With the mouse:
- Hold down the left mouse button and drag it across the text.
- Hold down the left mouse button and lasso the text with the mouse.
- Double-click to select the current word.
- Triple click to select the curent line.
- With the mouse and keyboard:
- Hold down the left mouse button and press the PgUp or PgDn key.
- Hold down the left mouse button and press the Ctrl key.
- Hold down the left mouse button and the Ctrl and Shift and End keys.
- Hold down the Ctrl key while making multiple selections.
- Select some text and press the Ctrl and Ins keys together.
For more details about how all of this works, see the "Peer-to-Peer Communication by Means of Selections" section in the Inter-Client Communication Conventions Manual.
@Elliria It's code as in some sort of character code, not program code.
When it detects
<code
, it takes a substring starting at character 5 (just past<code
and goes to one char short of the end of the string which suggests that it's stopping just before the matching>
and turning that into an integer character ordinal or scan code, etc. I don't believe this uses a block command syntax like in html or xml. There is no<\code>
.If I couldn't figure out what it does from reading more of the AutoKey code (starting with that keysym_to_keycode array and the AK_TO_XK_MAP array) ...
What I would do is write a script that iterates from 1 to 127 (to start with) and shows what each code does.
and run it in an empty text editor window.
That should generate the range of values it emits so we can see a pattern pointing us to what those values correspond to.
Based on my initial tests, it looks similar to ASCII, but it doesn't quite line up.
If that doesn't work, you might have to do it as several separate substrings, etc.
This assumes we're dealing with a single byte code, not a multibyte one like UTF-8. That might not be a valid assumption.