[go: up one dir, main page]

CN107179834A - A kind of method and system by self-defined hot key control device unit - Google Patents

A kind of method and system by self-defined hot key control device unit Download PDF

Info

Publication number
CN107179834A
CN107179834A CN201610131573.7A CN201610131573A CN107179834A CN 107179834 A CN107179834 A CN 107179834A CN 201610131573 A CN201610131573 A CN 201610131573A CN 107179834 A CN107179834 A CN 107179834A
Authority
CN
China
Prior art keywords
unit
hot key
gpio
keyboard
self
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610131573.7A
Other languages
Chinese (zh)
Inventor
阮仕涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Prafly Technology Co Ltd
Original Assignee
Shenzhen Prafly Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Prafly Technology Co Ltd filed Critical Shenzhen Prafly Technology Co Ltd
Priority to CN201610131573.7A priority Critical patent/CN107179834A/en
Publication of CN107179834A publication Critical patent/CN107179834A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0238Programmable keyboards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

A kind of method by self-defined hot key control device unit, for SUPER I/O environments, methods described includes:S1, the unit that will be controlled and CPU corresponding GPIO mouthfuls of connections;S2, the hot key composition for determining the control unit;S3, the hot key based on determination constitute newly-built system process, the system process automatic loading and running background after starting operating system, and the system process is used for the key information for obtaining keyboard in real time;S4, such as judge that key information constitutes for step S2 hot key, then change the state of the GPIO mouths in step S1, so as to trigger being turned on and off for unit.The present invention passes through corresponding GPIO mouthful connections of the unit with CPU, newly-built system process obtains the key information of keyboard, decided whether to change GPIO mouthfuls of state according to key information, from bottom layer realization hot key control device unit, it is adapted to SUPER I/O environments, any keyboard on the market can be used in user, and function key can also self-defined hot key combination.

Description

A kind of method and system by self-defined hot key control device unit
Technical field
The present invention relates to Keyboard Control field, more particularly to a kind of method and system by self-defined hot key control device unit.
Background technology
Pass through the method for hot key control device unit, the row function key (FN+F1/F2 ... F12 keys) on the keyboard of notebook/net book is generally based in the prior art, opening/closing WIFI is beaten in realization, or beats opening/closing sound control, plays opening/closing screen backlight control etc..The implementation method is all to be combined transmission SCANCODE/Q_EVENT with BIOS to realize using EC (Embedded Controller).Although EC can also realize the self-defined hot key of producer, but it is confined to keyboard during product design, and function key is typically all FN Macintosh, all identification function icon on Macintosh, function needs to go to realize by icon function, and product is once shape, cannot be self-defined again, as FN+F1 indicates entry into sleep, FN+F2 represents Jing Yin switching, and FN+F3 represents display switching etc..
The content of the invention
The technical problem to be solved in the present invention is, for the drawbacks described above of prior art, there is provided a kind of method and system by self-defined hot key control device unit.
The technical solution adopted for the present invention to solve the technical problems is:A kind of method by self-defined hot key control device unit is constructed, for SUPER I/O environments, methods described includes:
S1, the unit that will be controlled and CPU corresponding GPIO mouthfuls of connections;
S2, the hot key composition for determining the control unit;
S3, the hot key based on determination constitute newly-built system process, the system process automatic loading and running background after starting operating system, and the system process is used for the key information for obtaining keyboard in real time;
S4, such as judge that key information constitutes for step S2 hot key, then change the state of the GPIO mouths in step S1, so as to trigger being turned on and off for unit.
It is the key information that keyboard is obtained by keyboard hook program in the method for the present invention by self-defined hot key control device unit, in the step S3.
In the method for the present invention by self-defined hot key control device unit, the system process described in the step S3 is loaded automatically after starting operating system and running background includes:Using vbs scripts, using WshShell objects, the newly-built system process is called.
In the method for the present invention by self-defined hot key control device unit, if one unit of some GPIO mouthfuls of control, the state of the GPIO mouths in change step S1 described in the step S4 includes:
If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is high level, then by the GPIO mouthfuls down for low level;If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is low level, then draws high the GPIO mouthfuls for high level.
The invention also discloses a kind of system by self-defined hot key control device unit, for SUPER I/O environments, including CPU and the unit that will control, the unit and CPU corresponding GPIO mouthfuls of connections, the CPU include:
Keyboard monitoring unit, newly-built system process, the system process automatic loading and running background after starting operating system, the key information of the system process acquisition keyboard are constituted for the hot key for controlling the unit based on determination;
GPIO control units, for when judging that the key information constitutes for the hot key, changing GPIO mouthfuls of state, so as to trigger being turned on and off for unit.
In the system of the present invention by self-defined hot key control device unit, the keyboard monitoring unit is the key information that keyboard is obtained by keyboard hook program.
In the system of the present invention by self-defined hot key control device unit, described system process is loaded automatically after starting operating system and running background includes:Using vbs scripts, using WshShell objects, the newly-built system process is called.
In the system of the present invention by self-defined hot key control device unit, if one unit of some GPIO mouthfuls of control, the state of GPIO mouthfuls described of change includes:
If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is high level, then by the GPIO mouthfuls down for low level;If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is low level, then draws high the GPIO mouthfuls for high level.
Implement the method and system by self-defined hot key control device unit of the present invention, have the advantages that:The present invention passes through corresponding GPIO mouthful connections of the unit with CPU, newly-built system process obtains the key information of keyboard, decided whether to change GPIO mouthfuls of state according to key information, from bottom layer realization hot key control device unit, it is adapted to SUPER I/O environments, any keyboard on the market can be used in user, and function key can also self-defined hot key combination.
Brief description of the drawings
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is method flow diagram of the present invention by self-defined hot key control device unit;
Fig. 2 is the system knot block diagram in a specific embodiment.
Embodiment
In order to which technical characteristic, purpose and effect to the present invention are more clearly understood from, the embodiment that accompanying drawing describes the present invention in detail is now compareed.
It is method flow diagram of the present invention by self-defined hot key control device unit with reference to Fig. 1.
The method by self-defined hot key control device unit of the present invention, for SUPER I/O environments, SUPER I/O chips are also I/O chips, 486 to there is I/O control circuits on the mainboard that improves grade.Because there will necessarily be the mismatch of resource between a large amount of low-speed devices such as high-speed equipment as south bridge and serial, parallel interface, floppy disk and keyboard and mouse, and need by conversion and manage, and Super I/O chips then complete the function.The method described in the present invention includes:
S1, the unit that will be controlled and CPU corresponding GPIO mouthfuls of connections;
S2, the hot key composition for determining the control unit;
S3, the hot key based on determination constitute newly-built system process, and the system process automatic loading and running background after starting operating system, the system process obtain the key information of keyboard;
S4, such as judge that key information constitutes for step S2 hot key, then change the state of the GPIO mouths in step S1, so as to trigger being turned on and off for unit.
Step S3 is specifically included:By a keyboard hook program WH_KEYBOARD, Keyboard Message WM_KEYDOWN, WM_SYSKEYDOWN, such as if (p- are obtained>It is self-defined hot key (CTRL+F3) that vkCode==0x72&&GetKeyState (VK_CONTROL) &0x8000), which judges, such as if (p->It is after two buttons of self-defined hot key (CTRL+F4) are pressed that vkCode==0x73&&GetKeyState (VK_CONTROL) &0x8000), which judges,.
The essence of hook is one section of program to processing system message, is called by system, is linked into system.The species of hook has a lot, and every kind of hook can be intercepted and captured and handle corresponding message, whenever specific message is sent, before purpose window is reached, and hook program intercepts and captures the message, obtains control to this message in advance.Now the message of intercepting and capturing can be just processed in Hook Function, it might even be possible to force the transmission of end.And keyboard hook, it is intended merely to intercept and capture Keyboard Message.Global hook can capture the keyboard operation on any window under windows platform.Broad sense hook refers to that directly modification instruction segment obtains the hook controlled.This hook is more powerful, and the behavior of computer can be arbitrarily changed in theory.
Keyboard hook is a kind of instruction that can be operated with supervisory keyboard.Keyboard hook be exactly using computer one by one configuration processor the characteristics of, a certain instruction is substituted for a jump instruction in processing keyboard system code segment, allow the process performing present invention's to be transferred to customized one section of code, add the instruction being replaced again at the ending of this code, allow original system to continue to run with next instruction for being finally transferred to the original place of being replaced.
In a specific embodiment, the automatic simultaneously running background that loads after starting operating system of the system process described in step S3 includes:Using vbs scripts, using WshShell objects, the newly-built system process is called:
Set wscriptObj=CreateObject (" Wscript.Shell ")
WscriptObj.run " newly-built system process ", 0
VBScript is Visual Basic Script abbreviation, i.e. Visual Basic scripts, and VBS is also abbreviated as sometimes.It is a kind of interpreted languages of the lightweight under microsoft environment, and it uses the element in com component, WMI, WSH, ADSI access system, system is managed.In Windows operating system, VBScript can be run in the range of Windows Script Host.Windows operating system can recognize and perform automatically * .VBS.WScript.Shell is the ProgID of WshShell objects, and creating WshShell objects can be with operation program, Registry, establishment shortcut, access system folder, management environment variable.
In addition, if one unit of some GPIO mouthfuls of control, the state of the GPIO mouths in change step S1 described in the step S4 includes:If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is high level, then by the GPIO mouthfuls down for low level;If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is low level, then draws high the GPIO mouthfuls for high level.
It is of course also possible to control multiple equipment unit using multiple GPIO mouthfuls combinations.For example, N number of GPIO mouthfuls, N >=2, then can have 2NOutput state is planted, N number of GPIO mouthfuls connects the multiple equipment unit to be controlled by a data selector, the 2 of N number of GPIO mouthfuls of composition can be setNOne of which output state in kind of output state, which is represented, closes all units, and then remaining 2N- a kind of output state control 2N- 1 unit.Exemplified by 3 GPIO mouthfuls, then 1 data selector is selected in corresponding connection for one 8, then can control 7 kinds of functions, such as WiFi function, backlight function, read-only function etc..3 GPIO mouthfuls of output state includes 000-111, and setting 000 is represented presses without any hot key, and 001 represents WiFi function, and 002 represents backlight function, and 003 represents read-only function by that analogy.
It is the system knot block diagram in a specific embodiment with reference to Fig. 2.Illustrate the present invention so that the hot key of read-only function is set as an example below, the embodiment is realized and goes to control read-only lock unit under an operating system by customized hot key, U KEY/U disks/CF cards/TF cards/SD card of insertion is possessed unidirectional read-only function.
On hardware configuration, CF cards, TF cards, SD card are connected into USB three-in-one card readers respectively first, U KEY, USB flash disk, USB three-in-one card readers are then connected into the read-only lock core chips of USB respectively again.According still further to step S1, the MINI-PCIE interfaces of the read-only lock core chips of USB and CPU GPIO interface are connected, to receive the DISABLE signals of the GPIO interface.
Then, then step S2 is performed, it is determined that controlling the hot key of the read-only lock core chips of the USB to constitute to be:Ctrl+F3 opens the read-only lock core chips of the USB, and Ctrl+F4 closes the read-only lock core chips of the USB.
Further according to step S3, the key information of keyboard is obtained based on keyboard hook program, if the keypad information obtained is Ctrl+F3 or is Ctrl+F4, GPIO mouthfuls of level is dragged down or draw high, so as to trigger being turned on and off for the read-only lock core chips of USB.
It is only an instantiation above, the hot key of other functions can be similarly set using this method.WIFI is for example opened/closes, hardware design needs GPIO to be connect the DISABLE signals on the MINI-PCIE interfaces of WIFI chips;Unlatching/closing bluetooth, hardware design needs GPIO to be connect the DISABLE signals on the MINI-PCIE interfaces of Bluetooth chip;Unlatching/closing 4G modules, hardware design needs GPIO to be connect the DISABLE signals on the MINI-PCIE interfaces of 4G modules;Screen backlight is adjusted, hardware design needs outer circuit of taking GPIO to be connected on the circuit of screen output.
The invention also discloses a kind of system by self-defined hot key control device unit, for SUPER I/O environments, including CPU and the unit that will control, the unit and CPU corresponding GPIO mouthfuls of connections, the CPU include:
Keyboard monitoring unit, newly-built system process, the system process automatic loading and running background after starting operating system, the key information of the system process acquisition keyboard are constituted for the hot key for controlling the unit based on determination;
GPIO control units, for when judging that the key information constitutes for the hot key, changing GPIO mouthfuls of state, so as to trigger being turned on and off for unit.
Wherein, the keyboard monitoring unit is the key information that keyboard is obtained by keyboard hook program.
Wherein, described system process automatic simultaneously running background that loads after starting operating system includes:Using vbs scripts, using WshShell objects, the newly-built system process is called.
Wherein, if one unit of some GPIO mouthfuls of control, the state of GPIO mouthfuls described of change includes:If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is high level, then by the GPIO mouthfuls down for low level;If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is low level, then draws high the GPIO mouthfuls for high level.
It is of course also possible to control multiple equipment unit using multiple GPIO mouthfuls combinations.For example, N number of GPIO mouthfuls, N >=2, then can have 2NOutput state is planted, N number of GPIO mouthfuls connects the multiple equipment unit to be controlled by a data selector, the 2 of N number of GPIO mouthfuls of composition can be setNOne of which output state in kind of output state, which is represented, closes all units, and then remaining 2N- a kind of output state control 2N- 1 unit.Exemplified by 3 GPIO mouthfuls, then 1 data selector is selected in corresponding connection for one 8, then can control 7 kinds of functions, such as WiFi function, backlight function, read-only function etc..3 GPIO mouthfuls of output state includes 000-111, and setting 000 is represented presses without any hot key, and 001 represents WiFi function, and 002 represents backlight function, and 003 represents read-only function by that analogy.
In summary, implement the method and system by self-defined hot key control device unit of the present invention, have the advantages that:The present invention passes through corresponding GPIO mouthful connections of the unit with CPU, newly-built system process obtains the key information of keyboard, decided whether to change GPIO mouthfuls of state according to key information, from bottom layer realization hot key control device unit, it is adapted to SUPER I/O environments, any keyboard on the market can be used in user, and function key can also self-defined hot key combination.
Embodiments of the invention are described above in conjunction with accompanying drawing; but the invention is not limited in above-mentioned embodiment; above-mentioned embodiment is only schematical; rather than it is restricted; one of ordinary skill in the art is under the enlightenment of the present invention; in the case of present inventive concept and scope of the claimed protection is not departed from, many forms can be also made, these are belonged within the protection of the present invention.

Claims (8)

1. a kind of method by self-defined hot key control device unit, for SUPER I/O environments, it is special Levy and be, methods described includes:
S1, the unit that will be controlled and CPU corresponding GPIO mouthfuls of connections;
S2, the hot key composition for determining the control unit;
S3, the hot key based on determination constitute newly-built system process, and the system process is in starting operating system Automatic afterwards to load and running background, the system process is used for the key information for obtaining keyboard in real time;
S4, such as judge that key information constitutes for step S2 hot key, then change the GPIO mouths in step S1 State, so as to trigger being turned on and off for unit.
2. the method according to claim 1 by self-defined hot key control device unit, its feature It is, is the key information that keyboard is obtained by keyboard hook program in the step S3.
3. the method according to claim 1 by self-defined hot key control device unit, its feature It is, the system process described in the step S3 automatic loading and running background after starting operating system Including:Using vbs scripts, using WshShell objects, the newly-built system process is called.
4. the method according to claim 1 by self-defined hot key control device unit, its feature It is, if one unit of some GPIO mouthfuls of control, the change step described in the step S4 The state of GPIO mouths in S1 includes:
If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is height Level, then by the GPIO mouthfuls down for low level;If under normal condition, in step S1 and tables of equipment Some GPIO mouthfuls of state of member connection is low level, then draws high the GPIO mouthfuls for high level.
5. a kind of system by self-defined hot key control device unit, for SUPER I/O environments, it is special Levy and be, including CPU and the unit that will control, the unit is corresponding with CPU's GPIO mouthfuls of connections, the CPU includes:
Keyboard monitoring unit, newly-built system process is constituted for the hot key for controlling the unit based on determination, The system process automatic loading and running background after starting operating system, the system process obtain keyboard Key information;
GPIO control units, for when judging that the key information constitutes for the hot key, changing GPIO The state of mouth, so as to trigger being turned on and off for unit.
6. the system according to claim 5 by self-defined hot key control device unit, its feature It is, the keyboard monitoring unit is the key information that keyboard is obtained by keyboard hook program.
7. the system according to claim 5 by self-defined hot key control device unit, its feature It is, described system process is loaded automatically after starting operating system and running background includes:Utilize vbs Script, using WshShell objects, calls the newly-built system process.
8. the system according to claim 5 by self-defined hot key control device unit, its feature It is, if one unit of some GPIO mouthfuls of control, the state of GPIO mouthfuls described of change includes:
If under normal condition, some GPIO mouthfuls of the state being connected with unit in step S1 is height Level, then by the GPIO mouthfuls down for low level;If under normal condition, in step S1 and tables of equipment Some GPIO mouthfuls of state of member connection is low level, then draws high the GPIO mouthfuls for high level.
CN201610131573.7A 2016-03-09 2016-03-09 A kind of method and system by self-defined hot key control device unit Pending CN107179834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610131573.7A CN107179834A (en) 2016-03-09 2016-03-09 A kind of method and system by self-defined hot key control device unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610131573.7A CN107179834A (en) 2016-03-09 2016-03-09 A kind of method and system by self-defined hot key control device unit

Publications (1)

Publication Number Publication Date
CN107179834A true CN107179834A (en) 2017-09-19

Family

ID=59829515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610131573.7A Pending CN107179834A (en) 2016-03-09 2016-03-09 A kind of method and system by self-defined hot key control device unit

Country Status (1)

Country Link
CN (1) CN107179834A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI798847B (en) * 2021-09-29 2023-04-11 宏正自動科技股份有限公司 Electric device and method of controlling multiple equipments

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038787A1 (en) * 2004-08-18 2006-02-23 Jia-Shiung Kuo Processing system and method for detecting hotkey activation
CN101414221A (en) * 2008-10-31 2009-04-22 深圳市神舟电脑股份有限公司 Method for implementing user-defined function of keyboard shortcut key
CN103634426A (en) * 2012-08-28 2014-03-12 上海千大信息科技有限公司 Key expansion circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038787A1 (en) * 2004-08-18 2006-02-23 Jia-Shiung Kuo Processing system and method for detecting hotkey activation
CN101414221A (en) * 2008-10-31 2009-04-22 深圳市神舟电脑股份有限公司 Method for implementing user-defined function of keyboard shortcut key
CN103634426A (en) * 2012-08-28 2014-03-12 上海千大信息科技有限公司 Key expansion circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI798847B (en) * 2021-09-29 2023-04-11 宏正自動科技股份有限公司 Electric device and method of controlling multiple equipments
US11822735B2 (en) 2021-09-29 2023-11-21 Aten International Co., Ltd. Electronic device and method of controlling multiple pieces of equipment

Similar Documents

Publication Publication Date Title
US9594904B1 (en) Detecting malware based on reflection
US8521929B2 (en) Virtual serial port management system and method
US9274804B2 (en) Overlapped boot task fetches and boot task execution to reduce boot time in an electrical device
US9468853B2 (en) Systems and methods for executable file identity capture during indirect application launch
CN103677872B (en) A kind of information processing method, device and electronic equipment
CN101907983A (en) Microphone mute control method and computer
US20140101768A1 (en) Limiting the Functionality of a Software Program Based on a Security Model
CN109995805B (en) Intelligent robot management method, terminal device and medium
US9563581B1 (en) Remote-session keyboard and mouse input via generic device redirection
CN108399331A (en) Application process trial method and system
CN106502713A (en) A kind of method for upgrading software and system
US8484447B2 (en) Selecting a compatible processor to control a peripheral component interconnect express (PCI-E) slot unit within a predetermined interval via a setting menu
CN101452403A (en) Drawing support method and device
CN106126206A (en) A kind of information processing method and electronic equipment
CN107544804A (en) The startup method and device of embedded system terminal development mode
CN107179834A (en) A kind of method and system by self-defined hot key control device unit
CN209199102U (en) A kind of auditing card based on TCM chip, Audit Module and auditing system
CN105302689B (en) Intelligent management method and device for computer system
US11928318B2 (en) AI-powered tagging and UI/UX optimization engine
CN117094002A (en) Container penetration method based on escape attack model
CN106295320A (en) A kind of android system customized desktop based on white list
CN106709338A (en) Program detection method and device
CN105323615B (en) The operating method of application and processing unit for set-top box or television set
CN115757084A (en) Test method and test device and storage medium
CN105740108B (en) A method of passing through network diagnosis computer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20210312