CC-Tweaked icon indicating copy to clipboard operation
CC-Tweaked copied to clipboard

PDA in offhand behavior

Open Void-Seeker opened this issue 1 year ago • 12 comments

When player is holding PDA in the offhand and right clicks into the air, PDA intercepts input from the player until Esc is pressed. This is great feature if you want to interact with the PDA, but it is extremely annoying when you don't need to interact with it, and you're holding it just to look at it's screen while it displays useful information. It would be good to have a way to enable/disable this feature on demand. To be honest, you rarely need to input something into the PDA while it is not in your main hand.

Void-Seeker avatar Sep 14 '22 17:09 Void-Seeker

I think I probably want to keep the existing behaviour as-is, but could allow say sneak+right clicking to open the full GUI.

@Wojbie, don't know if you have any thoughts?

SquidDev avatar Sep 17 '22 10:09 SquidDev

Sneak is often used as modifier for actions so i think this might be a good solution to keep sheep whole and wolf sated.

Wojbie avatar Sep 17 '22 10:09 Wojbie

https://github.com/cc-tweaked/CC-Tweaked/blob/c3b7302108928fa6b9920c75c28121d67dea70b3/src/main/java/dan200/computercraft/shared/pocket/items/ItemPocketComputer.java#L173

Just need to update this line here.

SquidDev avatar Sep 18 '22 10:09 SquidDev

Just want to clarify what exact user-experience problem I'm talking about. So, I went caving or building, or whatever. I have activated Pocket computer in my offhand to look at my GPS coordinates/network chat messages/whatever. With my main hand i have torches/blocks that i keep placing during normal gameplay. When I click normally on the blocks, everything works ok, I'm able to place blocks as i intend, but if I happen to misclick and no block is tagreted by the game, PDA partially intercepts my keyboard input, I'm unable to move and press buttons unless I press Esc. However, mouse is still not intercepted, and some keys are still not passed to the PDA (for example, i can't use arrows to scroll commands in the console). This behavior is inconsistent and annoying, especially when this happens when i need to fight mobs. So maybe it is better to make it intercept input only if sneak-clicked, or other key combination is pressed, etc.

Void-Seeker avatar Sep 18 '22 11:09 Void-Seeker

Welll.. it is supposed to allow you to use mouse to interact with world around. So ability to look around and interact with mouse is part of the idea. Inability to pass arrow keys into computer sounds odd.. I swear it worked when i tested it. I will look into that.

If it was shift-rclick to open the TypingOnly mode then r-clicking would just open normal user gui. so you still would need to press esc to close it. I really don't see what point you are trying to make here? In either option you need to press esc to go out of the pocket control. Could you elaborate a bit more? Are you suggesting that pocket in off-hand should not be openable?

Wojbie avatar Sep 18 '22 12:09 Wojbie

and some keys are still not passed to the PDA (for example, i can't use arrows to scroll commands in the console).

That definitely sounds like a bug. Which Minecraft version are you on? - I can't reproduce on 1.19.2 at least.

SquidDev avatar Sep 18 '22 12:09 SquidDev

Slightly orthogonal, but I also wonder if we could do a better job of making it more obvious you've got the UI open. OC2 for instance adds a border on the whole screen.

SquidDev avatar Sep 18 '22 12:09 SquidDev

This sounds really amusing and would definitely make it more visible. I wonder if CC normal border texture would look nice if used this way.

Wojbie avatar Sep 18 '22 12:09 Wojbie

Yes, mouse is ok. About arrow keys... I might be wrong, and it is actually working. The Idea is... You can already see screen when offhand, you can input by keyboard when it is in offhand. this is great. If you really need full GUI, you can switch hand. The only thing that i think would be enough is to make input interception to activate either on sneak-rightclick in the air, or by configurable key instead of regular right-click in the air. This will be enough to make it times less frustrating, and yet keep useful functionality.

Void-Seeker avatar Sep 18 '22 12:09 Void-Seeker

and some keys are still not passed to the PDA (for example, i can't use arrows to scroll commands in the console).

That definitely sounds like a bug. Which Minecraft version are you on? - I can't reproduce on 1.19.2 at least.

Yes, I messed up. Sorry guys. Keys are fine. I'm on 1.18.2, btw.

Void-Seeker avatar Sep 18 '22 12:09 Void-Seeker

Yes, mouse is ok. About arrow keys... I might be wrong, and it is actually working. The Idea is... You can already see screen when offhand, you can input by keyboard when it is in offhand. this is great. If you really need full GUI, you can switch hand. The only thing that i think would be enough is to make input interception to activate either on sneak-rightclick in the air, or by configurable key instead of regular right-click in the air. This will be enough to make it times less frustrating, and yet keep useful functionality.

Ok soo... just so i understand your properly. You are suggesting pockets should NOT open full gui when in offhand at all and only open the TypingOnly mode when shift-rclicked?

Wojbie avatar Sep 18 '22 12:09 Wojbie

Yes, mouse is ok. About arrow keys... I might be wrong, and it is actually working. The Idea is... You can already see screen when offhand, you can input by keyboard when it is in offhand. this is great. If you really need full GUI, you can switch hand. The only thing that i think would be enough is to make input interception to activate either on sneak-rightclick in the air, or by configurable key instead of regular right-click in the air. This will be enough to make it times less frustrating, and yet keep useful functionality.

Ok soo... just so i understand your properly. You are suggesting pockets should NOT open full gui when in offhand at all and only open the TypingOnly mode when shift-rclicked?

Yes, something like that will be more than enough. Full GUI in offhand mode is, IMHO, redundant. The one other solution i consider is allowing to configure hotkey in minecraft options menu to enter typing or full gui mode.

Void-Seeker avatar Sep 18 '22 15:09 Void-Seeker

I think I'm going to close this. There's definite improvements we could make to the UI (see # #1169), but I'm fine with the current system of using offhand pocket computers.

SquidDev avatar May 21 '23 10:05 SquidDev