Jump to content

Win-1252 Extended Keyboard


czardas
 Share

Recommended Posts

I can never remember the extended ascii codes and I find it tedious keep having to look them up, select them and then having to copy and paste them. So I decided to design an extended ascii virtual keyboard.

Posted Image

The layout is intended to be intuitive with numeric keys at the top, alphabetic keys on the left, puntuation in the middle and various other symbols appearing to the right. Keys can not be held down since the virtual keyboard needs to lose focus in order to interact with other windows.

The method used is an adaptation of the method used by Info in the following topic:

Reading Info's thread saved me some time, and credit must also go to the MvPs who contributed to that project.

Not all extended ascii characters are included. Four of the keys on the left act as letter modification locks which effect the letters a, e, i, o, u and y. If you wish to type the actual character displayed on one of the modifier keys, you must press the shift key on your main computer keyboard. To type capital letters you can use the shift key or the caps lock key on your main keyboard.

PROBLEMS POSTING THE LATEST CODE

The latest code did not display as intended, since the forum software is confusing part of my my code for html. The html entites are displaying as characters and not as code. You need to download the zip file below to view the source. The zip also includes the compiled script, image resources and READ ME.txt which contains important information.

This script is a spin off from a bigger project, so I have only developed it to the point where it became a functional tool. I don't intend to take the development of this much further, unless by request; however I will most likely use the keypad design layout for other projects in the future.

Change Log 01 Dec 2011

The following additional features have been added:

1. Send ASCII Number

2. Send ASCII Hex

3. Send Unicode Entry Point

4. Send Unicode Hex Entry Point

5. Send Html Entity

Change Log 31 Jan 2012

The following features have been added:

1. Check to see if the compiled script is already running.

2. Notification message if two instances of the script are running.

Change Log 10 Feb 2012 (including modifications to Melba23's code)

1.Minor code modifications and general improvements to look and feel factors.

2. Replaced imaged resources.

Modifications to Melba23's _Notify_WM_MOUSEACTIVATE

Func _Notify_WM_MOUSEACTIVATE($hWnd, $iMsg, $wParam, $lParam)

    #forceref $iMsg, $wParam, $lParam

    ; Check timer is not checking
    If $aNotify_Settings[0][5] Then
        Return
    EndIf
    ; Check handler not already retracting
    If $aNotify_Settings[1][5] Then
        Return
    EndIf
    ; Set flag to show handler retracting
    $aNotify_Settings[1][5] = True

    ; Declare flag
    ;Local $fMoved = False ; Commented out by czardas

    For $i = $aNotify_Data[0][0] To 1 Step -1
        If $aNotify_Data[$i][3] And $hWnd = $aNotify_Data[$i][0] Then
            _Notify_Delete($i)
            ; $fMoved = True ; Commented out by czardas
            ; ExitLoop ; Commented out by czardas
        EndIf
    Next

    ; Adjust positions of Notifications
    ;If $fMoved Then ; Commented out by czardas
    ;   _Notify_Reset($i) ; Commented out by czardas
    ;EndIf ; Commented out by czardas

    ; Clear Running flag
    ;$aNotify_Settings[1][5] = False ; Commented out by czardas

    ;Return "GUI_RUNDEFMSG" ; Commented out by czardas
    Exit ; Added by czardas

EndFunc ;==>;_Notify_WM_MOUSEACTIVATE

The above alterations force the application to exit when you click on the notification message. They are not intended for general use with other scripts.

Change Log 05 Jan 2013

Improvement to the mouse over pop-up title bar, enabling you to drag other windows behind the keyboard without them being automatically dropped.


Download the latest version of win-1252.

win-1252v1.4.zip

SHA-1 0C03C570A45386FBA9C4ADB0AD030DFB7D699614

Previous downloads 116

by Melba23 are now included in the zip file. I have slightly modified M23's UDF, but this change isn't a requirement. See Change Log 10 Feb 2012 above.

Edited by czardas
Link to comment
Share on other sites

Very nice czardas.

In the thread you referred to wraithdu explained how to make the keyboard so that it never took the focus and I think it would be good to use that idea.

Instead of having the letter typed into the active window, could you make an option to insert the ascii code instead, maybe like "Chr(230)", and an option to not insert anything but just display the code for the last key pressed.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Thanks Martin. I will implement sending the ascii codes as an option shortly. Perhaps it would be a good idea to also include html codes. Regarding another method, without taking focus. I don't exactly understand (from reading that thread) what you mean. Surely the keyboard will always take focus when it is clicked (or if you drag the window), even if just for a fraction of a second. I think. :D

Quoting from the thread.

I'm suprised after that other thread this was how you chose to do it, but so be it.

I wish I knew which other thread wraithdu was refering to, since I couldn't find it. Perhaps that's where I can find a better method. Perhaps that's also what you are refering to. I'll look again and see if I can find the mystery thread.

Edited by czardas
Link to comment
Share on other sites

..

I wish I knew which other thread wraithdu was refering to, since I couldn't find it. Perhaps that's where I can find a better method. Perhaps that's also what you are refering to. I'll look again and see if I can find the mystery thread.

have a look

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

have a look

Thanks Martin. I wish I had found that thread earlier. It certainly looks very nice, but I'm not sure if I will be able to drag the keyboard around with the mouse if I use wraithdu's method. I'll have to study it and see if that's possible. I have a feeling that you need to allow the GUI to gain focus in order for dragging to work. I need a break right now though, but I will look into it soon.

Also thanks to you too Wakillon. I'm glad you like the design.

Edited by czardas
Link to comment
Share on other sites

I have implemented Martin's suggestions above (thanks for that), and solved the question of dragging a GUI without focus. Additional features include sending ASCII numbers, hex numbers, unicode entry points, unicode hex and html entities. Also several improvements have been made to the font choices on the buttons. See first post for the updated version.

Edited by czardas
Link to comment
Share on other sites

It's very good now; I like the improvements you have made: the pop-up caption works very well, the code option buttons are great.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Thanks for pointing me in the right direction. I very much appreciate your comments. This keyborad will certainly save some time, for me at least.

One thing I can't get over is how the keys arranged themselves naturally into a perfect rectangle. All I did was remove all non displaying characters, and determine which letters required modification. The result was that exactly 70 keys were needed. How convenient is that?

:D

Edited by czardas
Link to comment
Share on other sites

just a note, with the 'html' held if i press the 'ž' button it opens internet explorer

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

Thornhunt, I believe I have traced the cause of the problem. I had indeed had a slight oversight regarding sending the html code for ž. Thanks for alerting me to this. The modified script above should fix the problem. Please let me know if the problem persists.

Edited by czardas
Link to comment
Share on other sites

  • 1 month later...

it works fine now, glad i could help

p.s sorry for the late reply

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

  • 4 weeks later...

New version 31 Jan 2012 includes a bug fix. Running two versions of the script caused interference with the popup window title bar. The bug has been fixed in the latest version, however the source should be compiled for the program to work as intended. I have left the original code in the first post. The executable and the latest source plus image resources needed to compile the script are included in zip file.attached to the end of the first post.

The new version uses Notify.au3 by Melba23. :) You will have to download Melba's stuff from the links provided if you wish to compile the script yourself.

Link to comment
Share on other sites

  • Moderators

czardas,

Very nice! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...

This latest version (10 Feb 2012) has undergone one or two very minor tweaks and is now ready for official release, (I still need to add it to my website - when I find time). See change log in the first post. To view the source you need to download the zip attachment. Unfortunately I couldn't post the code on the forum because the software wouldn't let me. This is a bug with the forum code boxes, and has nothing to do with the code I wrote. You will find further explanation in the first post.

The second occurence now exits more gracefully if a user tries to simultaneously run the program twice. The program no longer displays a second tray icon if this happens. I have also included some new documentation and added some colour to the icon.

Edited by czardas
Link to comment
Share on other sites

  • 10 months later...

I finally got around to making one more significant improvement to this which I had planned a while ago. The problem with the old pop-up title bar was that it often interfered when dragging other windows behind the keyboard. If the mouse entered the area of the hidden title bar, it would drop the first window and focus on the keyboard instead. This was very easy to fix in just two lines of code, although at first I thought it would be more difficult. While the previous version worked quite well, it's certainly much better now that this problem has been ironed out. See Change Log 05 Jan 2013 in the first post. The latest version v1.4 is in the zip file attachment.

I thought of replacing the Send() function in various ways, but decided it was too much effort for too little gain: due to the multitude of different types of control that will be receiving the key strokes. I also tried sending some keys using alternative Window's codes but was never satisfied with the results. Consequently, some keys may trigger a mysteriously hidden accelerator in certain applications. For example sending the character í opens print preview in MS Word 2003, but behaves normally in notepad and in this forum editor. Such instances appear to be quite rare, so I don't think it's a big deal. You can still copy and paste into MSO.


I believe the majority of Windows operating systems with the following regional language settings will use the Windows 1252 codepage by default.

Afrikaans, Alberian, Basque, Catalan, Danish, Dutch, English, Faroese, Finnish, French, Galician, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Scottish, Spanish, Swedish

If your language is listed above and the keys on the keyboard do not match those from the screen shot in the first post, please let me know. Thanks.

Edited by czardas
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...