Skip to content
/ keysnap Public

License

Notifications You must be signed in to change notification settings

mzums/keysnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 6, 2025
993ccec · · Aug 6, 2025

History

5 Commits
Aug 2, 2025
Aug 6, 2025
Aug 6, 2025
Aug 5, 2025

Repository files navigation

Keysnap

A desktop app designed to help you master keyboard shortcuts

alt text

Features

  • Add, edit, and delete keyboard shortcuts
  • Organize shortcuts by category
  • Search and filter shortcuts
  • Persistent storage of your shortcuts
  • Quiz difficulty levels
  • Right click on list element to view delete button

Requirements

  • Python
  • Tkinter

Setup

  1. clone repo
    git clone https://github.com/mzums/keysnap
  2. run
    python main.py

RAM Optimization Techniques

  1. __slots__ in classes

    class ShortcutManager:
         __slots__ = ('filename', '_shortcuts', '_categories')
    • replaces dynamic __dict__ with fixed attribute lists
  2. Memory pooling for categories

    if category not in self._categories:
         self._categories.append(category)
    
    category_idx = self._categories.index(category)
    • stores category strings once and reuses them
  3. Tuple-based data storage

    self._shortcuts.append((shortcut, description, category_idx))
    • more memory-efficient than dictionaries/objects
  4. Binary storage with fixed-size records

    f.write(struct.pack('II', len(self._shortcuts), len(self._categories)))
    • more compact than text formats (JSON/XML)
  5. Lazy loading for quiz data

    def refresh_available(self):
         self.available_shortcuts = self.app.manager.get_shortcuts()
    • only loads quiz data when needed
  6. Selective UI updates

    self.app.list_frame.refresh_list()
    
    self.app.quiz_frame.refresh_available()
    • updates only necessary components
  7. Efficient string handling

    self.shortcut_var = tk.StringVar()
    • uses Tkinter's optimized string management
  8. Pre-display data filtering

    for item in self.app.manager.get_shortcuts(category):
         if search_term in shortcut.lower()...
    • avoids storing invisible items in GUI widgets

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages