This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2021-154445, filed Sep. 22, 2021, the entire contents of which are incorporated herein by reference.
The present disclosure relates to an electronic apparatus control method and storage medium.
Recently, small electronic computers called scientific electronic calculators, which is capable of performing a variety of calculation processing including functional calculation, have been in widespread, practical use. Further, as described in Jpn. Pat. Appln. KOKAI Publication No. 2010-079661, computation on a level with that of a scientific electronic calculator can be executed in an electronic apparatus (e.g., a personal computer) by causing the electronic apparatus to execute a scientific-electronic-calculator emulator program.
Further, some scientific-electronic-calculator emulator programs include a key logging function. The key logging function is a function capable of recording key input operations executed for executing a computation as key log data and capable of playing back the computation based on the recorded key log data.
A scientific electronic calculator is equipped with not only functions of typical numeric calculations but also functions (applications) for executing particular computational processing. Examples of the particular computation processing include graph drawing, trigonometric function computation, statistic calculation, and matrix calculation. For example, a scientific electronic calculator displays a plurality of functions in a menu in list form, and in a case where a position to which a function in the menu is assigned is indicated by a key operation, the scientific electronic calculator executes the function at the indicated position.
By the key logging function, in a case where a key operation for indicating a function is performed from a menu, a piece of identification information (key code) indicating a key subjected to the key operation is stored as a record of a key log.
An electronic apparatus according to an embodiment of the disclosure includes: an input device; a storage; and at least one processor, wherein the processor identifies identification information on a key subjected to a key operation with the input device, determines, when the identification information is identified, whether the key operation satisfies a predetermined condition, and performs control in such a manner that, when the key operation is determined to satisfy the predetermined condition, virtual key information indicating a function that is designated by the key operation is stored in the storage rather than storing the identified identification information in the storage.
The components in the drawings are not necessarily to scale relative to each other.
Embodiments of the present disclosure will be described below with reference to the drawings.
In the present embodiment, the electronic apparatus 20 is assumed to be, for example, a personal computer. Note that the electronic apparatus 20 can be provided in various forms of electronic apparatuses such as a smartphone, a tablet PC, a game console, and a server. In a case where the electronic apparatus 20 is provided in the form of a server, an input operation is performed on another electronic apparatus (personal computer, etc.) connected over a network, and details of processing performed by the server based on the input operation are displayed on a display.
The electronic apparatus 20 reads a program recorded in a recording medium of various types or a transmitted program, thus having a configuration of a computer of which actions are to be controlled by the read program. The electronic circuit of the electronic apparatus 20 is provided with a central processing unit (CPU) 21.
The CPU 21 functions as a control device that controls the entire electronic apparatus 20. The CPU 21 controls actions of each component of the circuit based on a control program stored in a storage 22 in advance, a control program read into the storage 22 from an external recording medium 23 via a recording medium reading device 24, or a control program read into the storage 22 from an external apparatus (server 30, etc.) over a network N such as the Internet.
The control program stored in the storage 22 is run in response to an input signal (key input) based on a user operation from an input device 26 or a communication signal indicating that a connection is established with the external recording medium 23 such as an EEPROM (R), a RAM, and a ROM via the recording medium reading device 24.
The CPU 21 is connected to the storage 22, the recording medium reading device 24, a communication device 25, the input device 26 (keyboard, mouse, etc.), a display 27 (liquid crystal display (LCD), etc.). Note that a touch panel may be provided in place of the display 27 and used as the display and the input device.
The control program stored in the storage 22 includes a calculator emulator program 22a and the like. The calculator emulator program 22a is a program that executes computations equivalent to those of a scientific electronic calculator (device) in the electronic apparatus 20. The calculator emulator program 22a implements a calculator module 22a1 that performs (emulates) computations equivalent to those of a scientific electronic calculator in response to an input operation and a key logging module 22a2 that performs processing pertaining to key logging (see
Further, in the storage 22, key log data 22b, a key correspondence data table 22c, and the like are stored as the calculator emulator program 22a is executed.
The key log data 22b is stored by key logging processing by the calculator emulator program 22a (calculator module 22a1). The key log data 22b is data indicating pieces of identification information (key codes) of keys used in key operations. In a key log, items of key code data corresponding to a series of key operations for executing a computation are recorded on a time-series basis. The key log data 22b in the present embodiment includes, as the items of key code data, key codes as well as pieces of virtual key information that are recorded as a substitution for key codes (described later).
The key correspondence data table 22c includes items of data associated with key codes (pieces of identification information) each to be input by a key operation and specific pieces of virtual key information that correspond to key codes and are assigned to functions (applications) that are displayed in a menu in list form (see
When a key operation for recording a key log satisfies a predetermined condition, the CPU 21 acquires virtual key information corresponding to this key code from the key correspondence data table 22c instead of the key code input by this key operation. Then, the obtained virtual key information is recorded in the key log data 22b.
A case where a key operation satisfies the predetermined condition is assumed to be a case where, for example, the key operation is a key operation of designating a given function from a menu including a plurality of functions.
The key correspondence data table 22c is also used to acquire key codes corresponding to virtual key information recorded in the key log when key log playback processing is executed based on the key log.
Although a case where a key operation satisfies the predetermined condition is supposed to be a case where the key operation is a key operation of designating a given function from a menu including a plurality of functions. However, a key operation of another type may be used for the condition. For example, in a case where a plurality of keys provided in a key section 41 includes a key or keys of which assignments to functions can be changed by an update or the like (e.g., function keys F1 to F6), a case where a key operation is performed on such a key may be considered to satisfy the condition.
The communication device 25 performs communication control on communication with another electronic apparatus (e.g., the server 30) via the network N such as the Internet and a local area network (LAN) or performs communication control on near field communication, such as Bluetooth (R) and Wi-Fi (R), with another electronic apparatus at a short distance.
The electronic apparatus 20 configured in such a manner implements functions to be described in the following description of actions, by the CPU 21 controlling actions of each component of the circuit according to instructions written in various programs such as the calculator emulator program 22a, thus causing software and hardware to operate in cooperation with each other.
The calculator module 22a1 is a module that virtually executes functions of a scientific electronic calculator based on key operations on the input device 26. The calculator module 22a1 causes the display 27 to display a calculator emulator screen and to display a result of processing based on a key operation on the input device 26.
As illustrated in
The emulator image 40 is provided with the key section 41 in which keys equivalent to those of the scientific electronic calculator are arranged and is provided with a display 42 for displaying details of a computation.
The keys provided in the key section 41 are each associated with a given key of the input device 26 (keyboard). For example, numeric keys, function keys, and keys of elementary operations of arithmetic of the key section 41 are associated with keys of the input device 26 (keyboard) having their respective names. In a case where a key provided in the key section 41 has no counterpart in the input device 26 (keyboard), a given key of the input device 26 (keyboard) is assigned. For example, the tab [Tab] key of the input device 26 is assigned to the [AC] key of the key section 41, and the enter [Enter] key of the input device 26 is assigned to the [EXE] key of the key section 41.
Further, given keys in the key section 41 are assigned to letters of the alphabet (e.g., A to Z) because, for example, the alphabet is used for indicating a given position of one of a plurality of choices (icons, etc.) in a menu displayed on the display 42.
For example, a key 41A illustrated in
Note that a key operation on the key section 41 need not be performed only by an operation on the input device 26 (keyboard). The key operation may be a key operation performed by pointing (indication of a position) on the key section 41 displayed on the display 27 with a pointing device such as a mouse and a touchpad.
In a case where instructions to record a key log are given, the key logging module 22a2 receives key codes from the calculator module 22a1 and records the key codes in the storage 22 in the form of the key log data 22b. At this time, in a case where a key code received from the calculator module 22a1 represents a key operation satisfying the predetermined condition, the key logging module 22a2 looks up the key correspondence data table 22c and records a piece of virtual key information corresponding to the key code as a record of the key log data 22b in place of the key code.
In a case where instructions to play back the key log are given, the key logging module 22a2 looks up the key correspondence data table 22c to obtain key codes corresponding to the pieces of virtual key information recorded in the form of the key log data 22b and transmits the key codes to the calculator module 22a1.
In the menu 42A illustrated in
By performing a key operation on given one of the keys 1 to 9 and A to J each indicating a display position when the menu 42A is displayed, a function designated by the key operation can be executed. Note that the key section 41 does not include keys corresponding to the letters of the alphabet, and thus the letters of the alphabet are each assigned to a given function key in the key section 41.
As illustrated in
That is, for a function “RUN” 421 at a position of “H” in the menu 42A, a code “[0x0f0x12]”, which indicates a piece of virtual key information specific to the function (application) “RUN” is set in association with a key code [0x030x17], which indicates the key 41H assigned to “H” (e.g., the key “S-D” corresponding to a function of decimal representation). Further, for a function “Geometry” at a position of “I” in the menu 42A, a code “0x0f0x13”, which indicates a piece of virtual key information specific to the function “Geometry” is set in association with a key code [0x030x18], which indicates the key 41I of “I”. Likewise, for each function (application) in the menu 42A, a piece of virtual key information specific to the function is set in association with a key code of a key to be subjected to a key operation for executing the function. Note that key codes illustrated in
Note that, in the key correspondence data table 22c illustrated in
Next, actions in a first embodiment will be described.
In a case where the CPU 21 is instructed to record a key log by a user operation, based on key operations for computational processing performed on the input device 26 by a user, the CPU 21 causes the calculator module 22a1 to execute the computational processing and causes the key logging module 22a2 to execute recording of the key log.
The example illustrated in
Thereafter, the user performs key operations on a key 412 for “2”, a key 413 for “3”, a key 41+ for “+”, a key 414 for “4”, and a key 415 for “5”, and finally performs a key operation on a “EXE” key 41 for indicating the execution of the computation.
The calculator module 22a1 identifies a key code (a piece of identification information) corresponding to each of the key operations received as the key operations performed on the input device 26. Based on the key codes corresponding to the key operations, the calculator module 22a1 sequentially displays the input letters (an expression) on the display 42, executes a computation based on the key code for indicating the execution of the computation, and displays the result of the computation 68″.
At the same time, the calculator module 22a1 transmits sequentially the key codes received from the input device 26 by the key operations to the key logging module 22a2 to record the key codes as records of a key log.
In a case where the key logging module 22a2 receives a key code from the calculator module 22a1 (step A1), the key logging module 22a2 determines whether the menu 42A is being displayed on the display 42. If the menu 42A is being displayed (step A2, Yes), the key logging module 22a2 determines whether the key code indicates a key operation for designating a function (application) set in the menu 42A. That is, whether the key operation satisfies the predetermined condition is determined.
Here, if the key operation is a key operation for a given function displayed on the menu 42A (in the example illustrated in
In place of the key code received from the calculator module 22a1, the key logging module 22a2 adds the piece of virtual key information obtained based on the key correspondence data table 22c to the key log data 22b as a record of a key log (step A5).
For example, in a case where a key operation on the letter “H” (key 41H) indicating the position of the icon of the function (Run) illustrated in
If the menu 42A is not being displayed (step A2, No) or if the key operation is not a key operation for designating a function (application) even while the menu 42A is being displayed (step A3, No), the calculator module 22a1 adds the key code received from the calculator module 22a1 to the key log data 22b as it is (step A5).
In a case where a key operation for computational processing is not finished (step A6, No), the CPU 21 (the key logging module 22a2) repeats the processing described above (steps A1 to A5). If the key operation for computational processing is finished (step A6, Yes), the CPU 21 finishes the key logging processing.
In an example illustrated in
Next, a case where a function is added to the menu 42A by an update or the like will be described.
In the menu 42B illustrated in
In this manner, in a case where an update of adding a function to the menu 42B is performed, the key correspondence data table 22c is also updated based on the addition of the function.
As illustrated in
By adding the function “Distribution” to the position of “H” in the menu 42B, the function “RUN” is moved to the position of “I” in the menu 42B, the function “Geometry” is moved to a position of “J”, and the function “Picture Plot” is moved to the position of “K”. Therefore, for the key codes KC in the key correspondence data table 22c, the key code [0x030x18] to be input by a key operation on “I” in the menu 42B is associated with the function “RUN”. Likewise, the key code [0x030x19] for “J” is associated with the function “Geometry”, and the key code [0x030x1a] for “K” is associated with the function “Picture Plot”.
In contrast, as to the virtual key information VC, the functions are associated with the same pieces of the virtual key information VC as those before the functions are added, as in
In the menu 42B illustrated in
In this manner, in the first embodiment, even in a case where an addition (or change) of a function to the menu 42A causes movement of positions of functions in the menu, a key code received by a key operation for designating a function in the menu can be recorded as a record of the key log data 22b in the form of a piece of virtual key information specific to the function. This allows a user to recognize a key log displayed as a correct key log according to a current arrangement of functions even before and after addition of a function.
Further, this enables the same computational processing as that performed while its key log is recorded to be played back irrespective of addition (or change) of a function to the menu 42A, by the key log playback processing described below.
Next, the key log playback processing by the key logging module 22a2 in the first embodiment will be described.
In a case where a key log (key log file) to be played back is selected by a user operation from the key log data 22b stored in the storage 22, by which instructions to execute the playback are given, the CPU 21 shifts to a playback state of the key log to be played back. The CPU 21 causes the file area 50 for displaying content (key codes) of the key log to be displayed on the calculator emulator screen.
In the key log playback processing, the key logging module 22a2 sequentially reads the key codes from the key log and transmits the key codes to the calculator module 22a1. Based on the key codes received from the key logging module 22a2, the calculator module 22a1 sequentially displays symbols of keys subjected to key operations in the file area 50 and executes a playback of a computation corresponding to the key log by executing the same processing as those performed when the key operations are performed and displaying details of the computation on the display 42.
Here, consider a key log playback with the key log data 22b that is recorded before a function is added to the menu 42A.
As illustrated in
Therefore, in the file area 50, a symbol LM1 for “S-D” (indicating the key 41H) corresponding to a key operation for indicating the function (Run) and then symbols corresponding to keys “2”, “3”, “+”, “4”, “5”, and “EXE” are sequentially displayed as the computation based on the key codes is played back.
Next, a case where a key log playback is executed after a function is added, based on the key log data 22b illustrated in
As illustrated in
After the function “Distribution” is added, the function “Distribution” is assigned to the position of “H” in menu 42B as illustrated in
On the other hand, although the function (Run) is executed in a case where the key log is recorded, at the time of playing back the key log, the function “Distribution” in the current menu 42B after the addition of the function is executed, and a screen showing details of a computation by the function “Distribution” is displayed on the display 42.
The key log data 22b illustrated in
Next, a key log playback based on the key log data 22b illustrated in
The key logging module 22a2 reads an item of key code data from the key log data 22b (step B1). In a case where the item of key code data is a piece of virtual key information (step B2, Yes), the key logging module 22a2 looks up the key correspondence data table 22c with the piece of virtual key information and obtains a key code corresponding to the piece of virtual key information.
For example, in a case of a piece of virtual key information L21 [0x0f0x12] read from key log data 22b (L2) in
The key logging module 22a2 transmits the key code [0x0f0x18] corresponding to the piece of virtual key information to the calculator module 22a1 (step B4).
This enables the calculator module 22a1 to execute, based on the key code [0x0f0x18] indicating “I”, the function 423 (Run) assigned to the position of “I” in the menu 42B (
In contrast, if the item of key code data read from the key log data 22b is not a piece of virtual key information (step B2, No), that is, if the items of key code data is a key code, the key logging module 22a2 transmits the item of key code data to the calculator module 22a1 as it is.
If reading of all items of key code data in the key log data 22b is not finished (step B5, No), the key logging module 22a2 repeats the processing described above (steps B1 to B4). If the reading of all items of key code data is finished (step B5, Yes), the CPU 21 finishes the key log playback processing.
Subsequently, a computation is played back based on key codes of key operations on “2”, “3”, “+”, “4”, “5”, and “EXE”, a screen showing details of the same computation as that performed where the key log is recorded is displayed on the display 42, and symbols corresponding to the key codes are displayed in the file area 50.
Here, assume that a key operation for indicating the icon of the function 423 (Run) displayed at the position of “I” is performed in the menu 42B after the addition of a function to execute an addition of “23+45” as described above. In this case, the key log data 22b as illustrated in
That is, the key log data 22b illustrated in
In this manner, even in a case where positions of functions are moved by a change of the arrangement of functions or the number of functions made in the menu 42A by an update or the like, the electronic apparatus 20 in the first embodiment handles the key log data 22b that has been recorded in the storage 22 in the same manner before and after the change in the menu, so that proper key log data can be output.
Next, actions in a second embodiment will be described.
In the first embodiment, the key logging module 22a2 looks up the key correspondence data table 22c and obtains a piece of virtual key information corresponding to a key code if a key operation satisfies the predetermined condition. In the second embodiment, a calculator module 22a1 obtains a piece of virtual key information corresponding to a key code.
In this case, as with the key logging module 22a2 described in the first embodiment, the calculator module 22a1 executes the processing of steps A2 to A4 in
In a case where key log playback processing is performed, the key logging module 22a2 transmits an item of key code data (a key code, a piece of virtual key information) read from the key log data 22b to the calculator module 22a1. In a case where the item of key code data received from the key logging module 22a2 is a piece of virtual key information, the calculator module 22a1 executes the processing of step B3 illustrated in
This enables the calculator module 22a1 to play back a computation based on key codes corresponding to pieces of virtual key information.
Note that, although a piece of virtual key information is supposed to be code data in the same format as that of a key code input by a key operation in the above description, an item of text data representing the name of a function (application) can be used as a piece of virtual key information.
For example, in a case where a key operation for indicating the execution of the function “RUN” is performed, the calculator module 22a1 transmits an item of text data “RUN” corresponding to the function “RUN” to the key logging module 22a2. The key logging module 22a2 records the item of text data “RUN” corresponding to the function “RUN” as a record of the key log data 22b.
In a case where the key log playback processing is performed, the key logging module 22a2 transmits an item of text data in the key log data 22b to the calculator module 22a1 as it is. The calculator module 22a1 obtains a key code corresponding to the function “RUN” corresponding to the item of text data and plays back a computation based on key codes as described above.
In a case where an item of text data representing the name of a function is used as a piece of virtual key information corresponding to the function, a symbol corresponding to the function displayed in a file area 50 can be provided as a symbol corresponding to the item of text data representing to the name of the function rather than a symbol of a key subjected to a key operation for inputting a key code.
Such a configuration enables an electronic apparatus 20 in the second embodiment to provide the same effect as in the first embodiment.
Techniques described in the embodiments can be distributed in the form of a program that can be executed by a computer with the program stored in a recording medium such as a memory card (ROM card, RAM card, etc.), a magnetic disk (flexible disk, hard disk, etc.), an optical disc (CD-ROM, DVD, etc.), and a semiconductor memory. The computer reads the program recorded in the recording medium, and by actions of the computer being controlled by this program, the same processing as the functions described in the embodiments can be implemented.
In addition, data used by the program for implementing the techniques can be transmitted over a network (the Internet etc.) in the form of a computer code, and program data can be fetched from a computer (server apparatus etc.) connected to the network to implement the same functions as in the embodiments described above.
Note that the present disclosure is not limited to the foregoing embodiments. For practical implementation, various modifications may be adopted without departing from the gist of the disclosure. Also, the embodiments may be discretionarily combined for implementation, and such combinations will produce combined effects. Still more, the foregoing embodiments involve various inventive aspects, and appropriate combinations of the features disclosed herein shall permit various inventions to be derived. For example, one or more of the features discussed for a certain embodiment may be omitted, and provided that such modification can solve the intended problem and bring the intended effects, the modification should be deemed an invention.
Number | Date | Country | Kind |
---|---|---|---|
2021-154445 | Sep 2021 | JP | national |