Pressing Keys - fruzyna/bearcat GitHub Wiki
The official API for most Bearcat scanner provides 4 ways to virtually interact with the keypad:
- Press
- Long Press
- Hold
- Release
These actions are paired with a single character representing a key on the keypad. You can find a scanners supported keys in the AVAILABLE_KEYS
array of any scanner class. The BC125AT supports the following keys:
- < - Turn the knob counter-clockwise
- ^ - Press the knob button
- > - Turn the knob clockwise
- H - Hold
- S - Scan
- R - Search
- L - L/O
- E - Enter
- P - Power
- F - Func
- Any number or '.'
bearcat Functions
This library supports all combinations of these actions and keys using the following calls.
press_key(key)
Sends a key press for a single given key.
# enter scan mode and toggle band 3
bc.press_key('s')
bc.press_key('3')
# activate backlight
bc.press_key('p')
press_key_sequence(keys)
Sends a key press for each key in the given string, in sequence. This is my personal favorite function. Not only does it let you quickly automate manual tasks, but it also sounds very fun when typing out a frequency to tune to.
# tune to, then save a new frequency
bc.press_key_sequence('462.5625h')
bc.press_key_sequence('fe^e.')
long_press_key(key)
Sends a long key press for any given key. The only use I know of for this function is to clear all locked out frequencies.
# clear all locked out frequencies
bc.long_press_key('L')
bc.press_key('E')
hold_key(key) and release_key(key)
Used in tandem to press and hold a key for a custom length of time. Normally long_press_key accomplishes the same task.
# clear all locked out frequencies
bc.hold_key('L')
sleep(2)
bc.release_key('L')
bc.press_key('E')