Tkinter Utilities

pumpia.utilities.tkinter_utils.tk_copy(text: str)

Copy text to the clipboard using tkinter.

pumpia.utilities.tkinter_utils.remove_state_persistents(state: int | str) int

Removes persistants (e.g. caps-lock, scroll-lock, num-lock) from a modifying state as described at https://wiki.tcl-lang.org/page/Modifier+Keys

Parameters:

state (int|str) – state of a tkinter event (tk.Event.state)

Returns:

the state without any persistants

Return type:

int

Raises:

ValueError – if state cannot be cast to an integer