jack-mil / bing-rewards

A script to automate daily Bing rewards points
MIT License
177 stars 23 forks source link

Chinese Input Method Prevents Search #35

Closed lxhzzy06 closed 1 year ago

lxhzzy06 commented 1 year ago

Due to the default activation of the Chinese input mode by the Microsoft Input Method in Chrome, it becomes impossible to input correct URLs or English keywords during searches, resulting in the inability to obtain rewards. Perhaps consider adding a flag to simulate pressing the Shift key, so that it can switch to English mode.

Screenshot: 屏幕截图 2023-07-31 102024

jack-mil commented 1 year ago

Can you describe how your setup normally works? Are you saying that in order to type in english with your keyboard layout, you need to press SHIFT once before typing? Or hold the key down?

lxhzzy06 commented 1 year ago

Yes! In order to type English, I need to press SHIFT once to switch to English mode. (only once)

lxhzzy06 commented 1 year ago

My English is not very good, and I believe the code expresses the meaning more accurately than I can in English.

def search(count, words_gen: Generator, agent, args, config):
    --snip--
    # Wait for Chrome to load
    time.sleep(args.load_delay or config.get("load-delay", LOAD_DELAY))

    # keyboard controller from pynput
    key_controller = keyboard.Controller()

    # Select the address bar
    key_controller.press(Key.alt)
    key_controller.press("d")
    key_controller.release("d")
    key_controller.release(Key.alt)

    # Switch to English mode
    key_controller.press(Key.shift)
    key_controller.release(Key.shift)
    print("Switch to English mode")
    --snip--
jack-mil commented 1 year ago

Please check the new 2.1.0 Release to see if that works for you :D