-
Jul 11th, 2021, 10:44 PM
#1
Thread Starter
Addicted Member
VB.NET Change Any keypress by another on any where
I'm trying to make every time I press a key on the keyboard it is replaced by special symbols anscii:
But in all textbox controls, richtexbox everything that can be entered a value.
But I have a form2 called with: me.controls.add(form2)
and also when I precionar selected in the second form that the same values are valid for any.
I thought of the following method:
Create a module with all key definitions:
Module:
Code:
Public sub keysubbcall()
If e.keypress = Keys.A then
Set selected.text = "AnciiCode112"
end if
If e.keypress = Keys.A then
Set selected.text = "AnciiCode113"
end if
end sub
So in the form's keydown call:
Code:
call module.kepress(keysubcall)
But from what I thought it doesn't work well, I'd like it to work in all but only selected regardless of the form, even if it's an exe called done in vb being toplevel(false)
is there any way to do this without using the method I've always done but always for something definite:
Code:
if e.keys = kepress.a then
textbox1.text &= "Ancii112"
end if
But I would like it to work on any text input control.
Code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Form1.Keypreview = True
End Sub
' Internet Ref:
'REM : https://stackoverflow.com/questions/13727172/vb-net-keydown-event-on-whole-form
'*************************************************************************
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
If e.Control AndAlso e.KeyCode = Keys.S then
' Call your sub method here .....
YourSubToCall()
' then prevent the key to reach the current control
e.Handled = False
End If
End Sub
Last edited by LiwisJames; Jul 13th, 2021 at 04:44 PM.
-
Jul 12th, 2021, 05:16 AM
#2
Re: VB.NET Change Any keypress by another on any where
1. anscii does not exist. What kind of special extended ASCII symbols?
2. Please use code tags.
3. KeyPreview can be set at design time. The rest of that code appears to be meaningless.
-
Jul 13th, 2021, 04:42 PM
#3
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Originally Posted by Peter Swinkels
1. anscii does not exist. What kind of special extended ASCII symbols?
2. Please use code tags.
3. KeyPreview can be set at design time. The rest of that code appears to be meaningless.
Sorry I got confused when writing it really is ASCII, well I want to insert characters with different numbers of representation so it doesn't need to be common characters besides I can see how the final result is.
Yes I must use tag in the code, I just had separated the code to explain and forgot to add as you can see at the end I had placed it.
The code makes sense well see use the logic is as follows when the key is pressed get the value of the textbox and add to the existing text the following ASCII.
Look:
Code:
if e.keypress = "A" then
textbox1.text &= "a" ' when used (&= ) it adds the equality of the new value to the text.
end if
-
Jul 13th, 2021, 05:54 PM
#4
Re: VB.NET Change Any keypress by another on any where
I hope you are not native English speaker because I'm feeling that my English went up a notch.
The code make no sense at all e.keypress? I propose you stick with assembly, you are better with it and you can do those thing more easily there.
Speaking of assembly, I'm yet to see any sample of the OS you are preparing. Can we see some some samples and explanations?
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jul 13th, 2021, 06:51 PM
#5
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Yes, I'm actually creating the concept in vb.net and I need to finish that, and then I need to start in assembly so I'm looking for a language that's simple or bouncy and quick to create as I would have to create memory controls again then vb.net is better to stop creating examples.
Last edited by LiwisJames; Jul 13th, 2021 at 07:00 PM.
-
Jul 13th, 2021, 07:01 PM
#6
Re: VB.NET Change Any keypress by another on any where
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jul 13th, 2021, 07:12 PM
#7
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Attachment 181847
See the SO concept.
-
Jul 13th, 2021, 07:15 PM
#8
Re: VB.NET Change Any keypress by another on any where
I better not.I'm not vaccinated.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jul 13th, 2021, 07:16 PM
#9
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
I put only basic and concept functions I put existing ones and created some but it's too early to put them all. Then I just need to replicate it, so I need the key control when pressed, because I want to change the order of some characters on the keyboard, I think there's a way to change it directly in memory too, right?
-
Jul 13th, 2021, 07:20 PM
#10
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Originally Posted by sapator
I better not.I'm not vaccinated.
LOL LOL
it's just a beta so I won't share it yet but when it's ready put on youtube, and I update, besides starting my OS assembly, I also have a brilliant idea to use this in GTK with linux.
-
Jul 13th, 2021, 07:23 PM
#11
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Originally Posted by Peter Swinkels
1. anscii does not exist. What kind of special extended ASCII symbols?
2. Please use code tags.
3. KeyPreview can be set at design time. The rest of that code appears to be meaningless.
I think the following use the keydowns when the key is pressed it will display the character I define anywhere is this possible? even if in a child form?
-
Jul 14th, 2021, 02:33 AM
#12
Re: VB.NET Change Any keypress by another on any where
Originally Posted by LiwisJames
I think the following use the keydowns when the key is pressed it will display the character I define anywhere is this possible? even if in a child form?
Yes, using custom characters is possible. It's called using another font. How about creating a font yourself?
-
Jul 14th, 2021, 08:33 AM
#13
Thread Starter
Addicted Member
Re: VB.NET Change Any keypress by another on any where
Originally Posted by Peter Swinkels
Yes, using custom characters is possible. It's called using another font. How about creating a font yourself?
I only created fonts in two ways for a site a long time ago, and by eucedit, but in this case it is viable instead of using ascii. because it's just an example of what it would be like if you changed the font.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|