Livewire: How to listen to presses of dot, comma, colon, and semicolon keys via wire:keyup and wire:keydown? - laravel-livewire

In Livewire documentation, there is a demonstration of a keydown event. It claims that to listen to a specific key, it is enough to add wire:keydown.MYKEY attribute to a DOM node, where MYKEY should be replaced with a KeyboardEvent.key property in kebab case.
Seems pretty straightforward, if not for a special case: what if I will need to listen for key events on keys ,, :, ; or even .? The symbols they print themselves are their key properties. There are possibly no special names for these keys, probably because in native JavaScript that could be handled by simply checking if a key property is equal to a stringified symbol of one of those keys.
How to handle this?

Related

AWS IAM - Safely concatenate generated Access Key ID and Secret Access Key

I want to concatenate my Access Key ID and Secret Access Key together so I can easily rotate the credentials with Azure Key Vault. I'm having trouble finding out which characters will not be used by either the generated Access Key ID or the Secret Access Key to keep them separated in the concatenated string. Is it safe to use a semicolon or a colon?
Edit: https://docs.aws.amazon.com/IAM/latest/APIReference/API_AccessKey.html indicates that the Access Key ID can contain any nonspace character, although I'm not sure if generated IDs are more limited in practice. Unfortunately, no guidelines are given for Secret Access Keys. Is a space a reasonable separator?
Amazon actually provide regular expressions for searching for access keys and secret access keys in this article, which we can use to tell what characters are used:
Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after.
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after.
So letters and numbers in the access key and those plus the characters /+= could appear in the secret key. This means a semicolon or a colon would be safe choices for a separator.

Does CComboBox control always takes capital letters as we type in it

I am using CComboBox control. When I type some characters in it and check which letter is typed in(in PreTranslateMessage()), then I always get capital letter in its message's wParam. My CComboBox control does not have uppercase property TRUE. Why this is happening?
Keys are funny things. What's the default state, lowercase or uppercase?
If you look at your keyboard, most likely the physical keys have uppercase letters on them. Default: uppercase
When you type in keys, you need to hold the shift key to create upper keys, without the shift keys you get lower case. Default: lowercase
As an alternative, you can use the Caps Lock key. Caps Lock is normally off . Default: lowercase.
The untranslated key presses sent to your application use VK_A - VK_Z keycodes. VK_A is 'A' not 'a'. Default: uppercase. Caps lock and shift are applied later, in translation.
This could have been designed consistently, but it wasn't, and now we're stuck with the mess to be backwards compatible. If you want the "normal" keyboard behavior, don't try to exactly replicate the OS behavior. There's stuff like "Sticky Keys" (hold shift to get Caps Lock-like behavior) which you might not even know. Instead, use the end result from the OS. For Windows, that's WM_CHAR.

Add a '~' symbol in the HL7 message

I have an HL7 Message exporting.
There's one field which has a tild symbol (~) in the input.
The HL7 is converting that into symbol "\R\"
I also tried exporting this value by using the ASCII value (126) for the '~' character using VBScript as I am .
But that was also converted by HL7 to "\R\"
How Can I get the '~' exported ?
Any Help would be appreciated.
HL7 escapes the repetition character "~" to "\R\" when transferring a message. The receiver should that change back to your tilde, when working with that field.
But there is a second way to deal with that issue. HL7 allows to change the encoding chars. Unfortunately not all HL7 engines support that.
This character (~) represents that this field can have multiple values.
Consider this PID.3 field from a given HL7 message
12345^^^XYZ~6789^^^PQR
What it means that, the patient has 2 patient ids coming from different sources viz. XYZ and PQR. This is what the (~) character means functionally.
If I go by the statement in the question body, I believe you want to achieve the functionality of (~).
To do this, try following below process. I don't know vbscript so I can't give you the code, however I have some Javascript code for the same, and I think you can mimic the same on vbscript. I'll leave that task to you.
//Calculates number of current repetitions by counting the length
var pidfieldlen=msg.PID['PID.3'].length();
//Store the last field node
var lastpidnode=msg['PID']['PID.3'][pidfieldlen-1]; //If length is 5,node index is 4
//Create new pid field and append with last pid node
var newpidfield=<PID.3/> //Creating new separate element for PID.3
newpidfield['PID.3.1']="567832" //Adding Field Values
newpidfield['PID.3.4']="NEW SOURCE"
lastpidnode.appendChild(newpidfield) //Adding above created to the last node
This will transform the PID.3 into
12345^^^XYZ~6789^^^PQR~567832^^^NEW SOURCE
Try to replace the tilde characters with ~ or ~ (decimal).
See the unicode reference for this character.
If you have already done so, this is not the source of error. I suspect that HL7 attaches a special meaning to this character. According to this webpage it denotes a "Field Repeat Separator".

How to use wm_deadchar to send non Ascii signs

i'm trying to send an umlaut keyevent with the function keybd_event. The Windows Documentation states that: "A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key."
How do i emit a dead key?
I tried the following without success:
keybd_event(WM_DEADCHAR,0x0103,0,0);
keybd_event(0x4F,0,0,0);
Sorry for my bad english.
I look forward to your reply.
The first argument to keybd_event is a virtual-key code. E.g. for my keyboard the dead key " is VK_OEM_7.

How can I limit CreateWindowEx to alphanumeric input only?

I know that ES_NUMBER exists to limit CreateWindowEx to numeric input only, is there a similar mechanism for limiting it to only alphanumeric (a-z,0-9) input? Or another way to do something similar. I know I can check after the fact, but I would like to limit it as the user types.
Check the EN_UPDATE message (via WM_COMMAND). It is sent just before the screen is updated; you can check the contents of the control and modify them if they contain any characters you don't want.