Giter VIP home page Giter VIP logo

onetouchsearch's Introduction

OneTouchSearch

A Windows tray icon program that emulates the One Touch Search feature of the old Logitech mice with SetPoint. When it is running and the user presses the default hotkey CTRL+ALT+SHIFT+K the currently selected text (in any application) is used to launch a search with the default browser.

Disclaimer

It's my first C++ project so I don't practice this language very well (actually, "at all"!). Feel free to submit PRs with code corrections and new features, if you like, because at the moment this is the maximum I can do. ๐Ÿ˜ƒ

Usage

  1. Either compile the source code with VS2010 or run the binary available on the Release section: an icon will be placed on the system tray.
  2. Important note: due to UIPI (User Interface Privilege Isolation), only if you run the application as Administrator it will be able to grab text from both admin and non-admin apps, so be sure to try both modes. Consider that the original One Touch Search from Logitech cannot grab text from admin apps, too.
  3. Select some text on a Windows application, such as Notepad or Word, etc..
  4. Press CTRL+ALT+SHIFT+K on your keyboard, a new browser tab (or instance) should search the highlighted text using Google US.
  5. (Optional) Assign the hotkey to one of the mouse buttons using Logitech Options, so you can search exactly as the old Logitech SetPoint feature with the same name.

Advanced configuration

As you may guess from the sources, I'm not able to create a UI for the configuration like for the Logitech's OneTouchSearch. But you can change the Search Engine and Hotkey from the registry, if you like.

How to change the Search Engine used

Open the registry key:

HKEY_CURRENT_USER\Software\OneTouchSearch

and change the value SearchEngineURL with the URL of your choice. Some examples:

  • Google Search in Italian https://www.google.it/search?hl=it&q=
  • Duck Duck Go in English https://duckduckgo.com/?q=

How to change the hotkey

This is more difficult, as it requires a DWORD value where the lower word is the key and the higher word is the modifier (CTRL, ALT, WIN, etc.). You'll have open the registry key:

HKEY_CURRENT_USER\Software\OneTouchSearch

and change the value Hotkey with the number that represents the combination of the two (LOWORD = key, HIWORD = modifier). For example this is how the default hotkey is converted to a number:

  1. The modifier are CTRL+ALT+SHIFT so consult this table for the related C++ Win32 constants:
  • CTRL = 0x0002
  • ALT = 0x0001
  • SHIFT = 0x0004
  1. Open the Windows Calculator in programmer mode and click on HEX to input and output hexadecimal values.
  2. Sum the values of the chosen modifiers, so 2 + 1 + 4 = 7 and multiply this value by 10000 (hex), you'll get 70000.
  3. The chosen key is K so consult this table for the related C++ Win32 constants:
  • K = 0x4B
  1. Add the key to the previous result (always in HEX mode), so you'll get 70000 + 4B = 7004B.
  2. 7004B is the value you'll have to put in hexadecimal mode into the registry value Hotkey.

Used libraries/code

This is a mash-up of different libraries/code samples found on CodeProject:

  • Clipboard Backup by sswater shi (link)
  • URL Encode by Daniel Cohen Gindi (link)
  • Tray Icon by Istvan Pasztor (link)

onetouchsearch's People

Contributors

virtualdj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.