Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Lisk · Jun 14, 2017 at 02:47 PM · keyboardkeypress

Is it possible to have hotkeys for characters like å, ä, ö?

I currently have a hotkey system working great for standard characters, like QWERTY.

However, some players would prefer hotkeys for characters like å, ä, ö, etc.

Is it possible to support this in Unity?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Quatum1000 · Aug 20, 2017 at 06:59 PM

Thanks to eskivor for this little script. On a german layout the following special keys are mapped.

 KeyCode.Quote = ä
 KeyCode.BackQuote  = ö
 KeyCode.Semicolon = ü
 KeyCode.Slash = #
 KeyCode.Equals = +
 KeyCode.RightBracket = ´
 KeyCode.LeftBracket = ß
 The only issue happen on ^ and <  they always respond KeyCode.Backslash
 

All other work as expected.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by eskivor · Jun 14, 2017 at 03:23 PM

You can find here the list of all keyboard characters recognized by Unity : https://docs.unity3d.com/ScriptReference/KeyCode.html

For special characters it can work, but you have to find first what is the equivalent key in QWERTY, for example the key "ù" in AZERTY correspond to "`" (BackQuote) in QWERTY.

To find which one it is : in the editor, in a project, you can add a script on a object of your scene and tap the key you want (å, ä, ö, etc.) it will print the QWERTY equivalent.

 using UnityEngine;
 using System;
 
 public class FindMyKeyInQwerty : MonoBehaviour
 {
     void Update ()
     {
         foreach (KeyCode keycode in Enum.GetValues (typeof (KeyCode)))
         {
             if (Input.GetKeyDown (keycode))
             {
                 Debug.Log ("Qwerty key is : " + keycode );
             }
         }
     }
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Z_Lokke · Jun 14, 2017 at 03:23 PM

I'll admit that I'm not 100% on this, but I don't believe these individual characters are supported in the Unity KeyCode API, which is found here:

https://docs.unity3d.com/ScriptReference/KeyCode.html

However, if these keys are found on your keyboard they may be coming through as inputs either way. Basically, since all keys correlate to a number received from the keyboard (like maybe a = 1 on a QWERTY keyboard), these special characters may be coming across as a different key. AKA, a character input like ö on a different keyboard format may be input using the same KeyCode as F, so when the user presses the special character the engine recognizes an F input. You could run a check to see if this is happening and try to line up your inputs appropriately. It could take a little bit and its definitely a work around, but worth a try.

Just a thought.

~Z

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

69 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Stimulate key press via a GUITexture 0 Answers

How to make a sprite fade in when I hit space? 0 Answers

GUI.Button's status react to keyboard event? 0 Answers

Forcing GetKeyDown by script. 2 Answers

Keyboard Input with a textbox 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges